Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Sophomoresty/bpc-fetch
/ functions
Functions
83 in github.com/Sophomoresty/bpc-fetch
⨍
Functions
83
◇
Types & classes
2
↓ 10 callers
Function
_text
(el, tag: str, ns: dict | None = None)
src/bpc_fetch/discover.py:214
↓ 7 callers
Function
_skip_ws
(text: str, i: int, length: int)
src/bpc_fetch/sites.py:140
↓ 6 callers
Function
get_sites_map
Get or build the sites strategy map. Caches to JSON for speed.
src/bpc_fetch/sites.py:259
↓ 5 callers
Function
_has_content
Check if HTML has meaningful content (not just a paywall/redirect).
src/bpc_fetch/strategy.py:176
↓ 5 callers
Method
bypass_type
(self)
src/bpc_fetch/sites.py:35
↓ 5 callers
Function
domain_from_url
Extract registrable domain from URL.
src/bpc_fetch/sites.py:274
↓ 4 callers
Method
start
(self)
src/bpc_fetch/browser.py:41
↓ 4 callers
Method
stop
(self)
src/bpc_fetch/browser.py:45
↓ 3 callers
Function
_image_filename
(url: str, index: int)
src/bpc_fetch/extract.py:204
↓ 3 callers
Function
_parse_date
(date_str: str | None)
src/bpc_fetch/discover.py:219
↓ 3 callers
Function
_read_string
(text: str, i: int, length: int)
src/bpc_fetch/sites.py:150
↓ 3 callers
Function
_read_value
Read a JS value: string, number, bool, regex, array.
src/bpc_fetch/sites.py:164
↓ 3 callers
Function
article_to_markdown
Convert extracted article to markdown with frontmatter.
src/bpc_fetch/extract.py:66
↓ 3 callers
Function
download_images
Download images to out_dir. Returns list of saved paths.
src/bpc_fetch/extract.py:109
↓ 3 callers
Function
extract_article
Extract article content from HTML. Returns dict with title, text, markdown, images. If dom_result is provided (from browser DOM extraction), use
src/bpc_fetch/extract.py:14
↓ 3 callers
Function
fetch_with_retries
Try primary strategy, fallback to googlebot, then browser, then archive.org. use_browser: True=force browser, False=skip browser, None=auto (bloc
src/bpc_fetch/strategy.py:79
↓ 3 callers
Function
get_db
(db_path: Path | None = None)
src/bpc_fetch/history.py:8
↓ 3 callers
Method
page
(self)
src/bpc_fetch/browser.py:52
↓ 2 callers
Function
_build_route_patterns
Convert BPC block_regex to Playwright route glob patterns.
src/bpc_fetch/browser.py:72
↓ 2 callers
Function
_build_strategy
(domain: str, name: str, props: dict)
src/bpc_fetch/sites.py:81
↓ 2 callers
Function
_escape_yaml
(s: str)
src/bpc_fetch/extract.py:213
↓ 2 callers
Function
_format
(item: dict, domain: str)
src/bpc_fetch/search.py:70
↓ 2 callers
Function
_is_article_url
Heuristic: URL looks like an article (has date pattern or article path).
src/bpc_fetch/discover.py:202
↓ 2 callers
Function
_is_paywalled
Detect if page shows paywall truncation markers.
src/bpc_fetch/strategy.py:196
↓ 2 callers
Function
_parse_sitemap
Parse sitemap XML.
src/bpc_fetch/discover.py:135
↓ 2 callers
Function
_read_object
(text: str, i: int, length: int)
src/bpc_fetch/sites.py:229
↓ 2 callers
Function
_slugify
(text: str)
src/bpc_fetch/cli.py:406
↓ 2 callers
Function
discover
Discover recent articles from domain. Returns {ok, domain, count, articles}.
src/bpc_fetch/discover.py:32
↓ 2 callers
Function
fetch_page
Fetch page HTML with bypass headers. Returns (html, status_code).
src/bpc_fetch/strategy.py:65
↓ 2 callers
Function
parse_since
Parse --since value: 'today', 'Nd', or 'YYYY-MM-DD'.
src/bpc_fetch/discover.py:18
↓ 2 callers
Function
search_sites
Search supported sites. Uses Brave API if available, otherwise returns empty.
src/bpc_fetch/search.py:60
↓ 1 callers
Function
_clean_paywall_text
Remove paywall/login prompts that leak into extracted text.
src/bpc_fetch/extract.py:217
↓ 1 callers
Function
_cmd_batch
(args)
src/bpc_fetch/cli.py:348
↓ 1 callers
Function
_cmd_crawl
(args)
src/bpc_fetch/cli.py:226
↓ 1 callers
Function
_cmd_discover
(args)
src/bpc_fetch/cli.py:220
↓ 1 callers
Function
_cmd_doctor
(args)
src/bpc_fetch/cli.py:152
↓ 1 callers
Function
_cmd_fetch
(args)
src/bpc_fetch/cli.py:299
↓ 1 callers
Function
_cmd_history
(args)
src/bpc_fetch/cli.py:244
↓ 1 callers
Function
_cmd_install_browser
(args)
src/bpc_fetch/cli.py:212
↓ 1 callers
Function
_cmd_search
(args)
src/bpc_fetch/cli.py:269
↓ 1 callers
Function
_cmd_sites
(args)
src/bpc_fetch/cli.py:250
↓ 1 callers
Function
_default_sites_js
Locate sites.js: PyInstaller bundle → package data → home fallback.
src/bpc_fetch/sites.py:9
↓ 1 callers
Function
_dispatch
(args)
src/bpc_fetch/cli.py:130
↓ 1 callers
Function
_emit_progress
(current: int, total: int, url: str)
src/bpc_fetch/crawl.py:126
↓ 1 callers
Function
_enrich_result
Add next_command and recovery_command to all results.
src/bpc_fetch/cli.py:96
↓ 1 callers
Function
_extract_author
(metadata: str | None)
src/bpc_fetch/extract.py:149
↓ 1 callers
Function
_extract_date
(metadata: str | None)
src/bpc_fetch/extract.py:156
↓ 1 callers
Function
_extract_entries
Extract site entries from JS object literal text. Handles regex literals, arrays, strings, numbers, booleans. Returns {site_name: {key: value
src/bpc_fetch/sites.py:96
↓ 1 callers
Function
_extract_image_urls
Extract article images only — skip UI, nav, footer, sidebar images.
src/bpc_fetch/extract.py:163
↓ 1 callers
Function
_extract_title
(html: str, metadata: str | None)
src/bpc_fetch/extract.py:139
↓ 1 callers
Function
_fetch_one
(item: dict, idx: int)
src/bpc_fetch/crawl.py:70
↓ 1 callers
Function
_fetch_one
(url: str)
src/bpc_fetch/cli.py:370
↓ 1 callers
Function
_has_full_article
Check if HTML likely contains a full article (not just first paragraph).
src/bpc_fetch/strategy.py:188
↓ 1 callers
Function
_parse_rss
Parse RSS/Atom XML into article list.
src/bpc_fetch/discover.py:84
↓ 1 callers
Function
_parse_sitemap_index
Parse sitemap index, fetch most recent sub-sitemap.
src/bpc_fetch/discover.py:154
↓ 1 callers
Function
_read_array
(text: str, i: int, length: int)
src/bpc_fetch/sites.py:213
↓ 1 callers
Function
_read_regex
(text: str, i: int, length: int)
src/bpc_fetch/sites.py:191
↓ 1 callers
Function
_regex_to_glob
Best-effort convert a simple regex fragment to a glob pattern.
src/bpc_fetch/browser.py:88
↓ 1 callers
Function
_slugify
(text: str)
src/bpc_fetch/crawl.py:132
↓ 1 callers
Function
_try_browser_homepage
Use Playwright to load homepage and extract article links (Cloudflare bypass).
src/bpc_fetch/discover.py:234
↓ 1 callers
Function
_try_homepage
Extract article links from homepage.
src/bpc_fetch/discover.py:177
↓ 1 callers
Function
_try_rss
Try common RSS feed paths.
src/bpc_fetch/discover.py:71
↓ 1 callers
Function
_try_sitemap
Try sitemap.xml for recent URLs.
src/bpc_fetch/discover.py:120
↓ 1 callers
Function
build
()
packaging/build_win.py:7
↓ 1 callers
Function
build_fallback_headers
Fallback: Googlebot UA + Google referer.
src/bpc_fetch/strategy.py:55
↓ 1 callers
Function
build_headers
Build HTTP headers based on the site's bypass strategy.
src/bpc_fetch/strategy.py:18
↓ 1 callers
Function
crawl
Search + discover + time filter + batch fetch. 1. If sites_filter given: discover from those sites, filter by since 2. Else: search query acr
src/bpc_fetch/crawl.py:17
↓ 1 callers
Function
expandSiteRules
(sites, updated = false)
data/sites.js:3779
↓ 1 callers
Function
extract_article_dom
Extract article content directly from page DOM. More reliable than trafilatura for JS-rendered pages.
src/bpc_fetch/browser.py:174
↓ 1 callers
Function
filter_urls
Filter a list of URLs to only those on supported paywall sites.
src/bpc_fetch/search.py:10
↓ 1 callers
Function
get_history
(domain: str | None = None, limit: int = 50, db_path: Path | None = None)
src/bpc_fetch/history.py:40
↓ 1 callers
Function
init_custom_flex_domains
()
data/sites.js:3834
↓ 1 callers
Function
is_fetched
(url: str, db_path: Path | None = None)
src/bpc_fetch/history.py:23
↓ 1 callers
Function
main
()
src/bpc_fetch/cli.py:11
↓ 1 callers
Function
mark_fetched
(url: str, domain: str, title: str, path: str, db_path: Path | None = None)
src/bpc_fetch/history.py:30
↓ 1 callers
Function
parse_sites_js
Parse sites.js and return {domain: SiteStrategy} map.
src/bpc_fetch/sites.py:54
↓ 1 callers
Function
search_brave
Search via Brave Search API. Requires BRAVE_API_KEY env var.
src/bpc_fetch/search.py:24
Method
__aenter__
(self)
src/bpc_fetch/browser.py:64
Method
__aexit__
(self, *_)
src/bpc_fetch/browser.py:68
Method
__init__
(self, max_contexts: int = 3)
src/bpc_fetch/browser.py:35
Function
ensure_browser
Check if Playwright Chromium is installed. Returns status dict.
src/bpc_fetch/browser.py:14
Function
fetch_with_browser
Fetch page using Playwright, blocking paywall scripts via route.
src/bpc_fetch/browser.py:105
Method
to_dict
(self)
src/bpc_fetch/sites.py:48