Repository navigation
The free-proxy rotation chain: harvest from public lists → validate → rotate
per request → feed every outcome back → refill on exhaustion. The engine
v2 and the self-healing freshness layer already existed; this change wires
them into the crawl path, fixes their deployment blockers, and adds the
first tests they ever had.
Fixed
proxy_engine_v2: cache path was a hardcoded absolute path from another
machine (/home/yu/...) — now project-relative.crawl_cache(env
OMK_CACHE_DIRstill wins). IPv6 probe no longer runs on the constructor's
critical path (lazy, once). Burned proxies are now persisted (in-memory
burn died on restart and the cache resurrected known-bad endpoints).- Protocol detection read the URL scheme, so every https-served text list
(all of GitHub raw) was labeledhttps. Detection now uses filename/query
markers (http.txt,protocol=socks5,type=http,HTTPS_RAW,
/socks5_list/) with the scheme excluded. aiohttp/aiohttp-sockswere lazy-imported but declared nowhere — new
proxyextra (pip install 'omk-crawl[proxy]'), included inall.
Added
- Freshness ("newest"):
ProxyNode.harvested_at/source; a source
re-serving a proxy touches its freshness instead of duplicating it;
STALE_SECONDS(default 1h,OMK_PROXY_STALE_SECONDS) demotes stale
entries in scoring andnext(fresh_only=True)excludes them. rotate_crawl.py—RotationCrawler: one pool proxy per attempt over
curl_cffiwith the node's assigned TLS profile; outcome feedback
(ok→score up, 429→per-proxy backoff, 407→burn, blocked/error→failure
streaks); bounded synchronous refill when the pool empties mid-crawl;
crawl_many()bounded concurrency.pool_cycles()is the bounded
무한의 굴레 loop (cycles=0 → until cancelled).proxy://scheme +ProxyPoolTool:proxy://stats(offline),
proxy://refresh,proxy://loop?cycles=N&interval=S. Bad query params
fail closed as results, never raise (BaseTool contract).- CLI
--proxy-pool: crawl a URL through the rotation pool. - 30 offline tests (
tests/test_proxy_rotation.py); suite now 714 passing.
Verification boundaries
- Live harvesting/validation against public proxy sources and the Firebase
validation target are network paths exercised only by the live lane — the
offline suite covers parsing, scoring, selection, feedback, persistence
and CLI plumbing with fakes. - Same-domain-style caveat: free proxies are untrusted third parties —
credentials or personal data must not transit them; the pool is for
public-content crawling only.