agentleFS
EastkapEastkap/autocomp/.claude/skills/fetch-protected/SKILL.md

fetch-protected

Skill4 starsChanged 5 months agoMITView on GitHub

Fetch a page that is behind a bot wall — Cloudflare / Turnstile / hCaptcha / reCAPTCHA / DataDome / Akamai — using a real human-like browser via TRAWL (a FlareSolverr-v2-compatible solver that drives a genuine Camoufox Firefox). Use when WebFetch/curl return a challenge page, 403, "Just a moment…", "Checking your browser", or an empty/blocked body, or when a task says to scrape/verify a site known to block bots. NOT for auth-gated sites (Reddit login, paywalls) — a solver doesn't beat a real login.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use: when a fetch returns: 403, 503, "Just a moment…", "Checking your browser", "Enable JavaScript and cookies", a …

    line 15
  2. Very specific:

    Escalate to it: only after a plain WebFetch fails.

    line 21
  3. Distinctive:

    If it does, the solve failed — report that, don't treat the challenge page as the answer.

    line 45

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

fetch-protected — read bot-walled pages with a real browser

Plain HTTP clients (curl, WebFetch) get a challenge page instead of content on Cloudflare/DataDome/etc. TRAWL solves the challenge in a real Camoufox Firefox context (fingerprint-spoofed at the engine level, not JS patches — so it reads as a human browser), then returns the solved HTML. It's FlareSolverr-v2-compatible and caches solved sessions in Redis, so repeat hits to the same domain come back in ~500ms.

When to use vs. not

  • Use when a fetch returns: 403, 503, "Just a moment…", "Checking your browser", "Enable JavaScript and cookies", a Turnstile/hCaptcha/reCAPTCHA widget, or a suspiciously empty body — i.e. a bot challenge, not a login.
  • Don't use for a real auth gate (Reddit "log in", paywalls, member areas). A solver passes bot checks; it does not have your account. For those, use a real logged-in session (OAuth token / persistent profile) — see tools/web.md.
  • Escalate to it only after a plain WebFetch fails. Plain HTTP is free and instant; the browser tier costs seconds. TRAWL itself does this internally (4 tiers: plain HTTP → cached session → live browser → residential proxy), so a single call is already cost-tiered.

How (always via the helper — never hand-roll the JSON)

Config: set TRAWL_URL in .env (e.g. http://localhost:8191 or your homelab URL).

tools/trawl.sh health                                  # is a solver reachable?
tools/trawl.sh get "https://target.example/page"       # -> solved HTML on stdout
tools/trawl.sh get "https://target.example" -s mysess  # reuse a cached session (fast repeats)
tools/trawl.sh get "https://api.example/x" -H 'Authorization: Bearer T' -H 'Referer: https://example'
tools/trawl.sh post "https://target.example/form" 'field=1&field2=2'
tools/trawl.sh json get "https://target.example"       # full JSON (cookies, userAgent, tier, status)

The helper shapes the FlareSolverr-v2 request (cmd:"request.get", url, maxTimeout, optional session/session_ttl, postData, headers) and returns solution.response (the HTML) on success. Custom headers pass through all tiers including the browser.

Success criterion (verify — Principle 4)

A solve is only "done" when the returned HTML contains the real content, not another challenge. After fetching, grep the body for the expected marker (a headline, a data field) AND confirm it does NOT still contain "Just a moment" / "cf-challenge" / a captcha widget id. If it does, the solve failed — report that, don't treat the challenge page as the answer.

Honest failure / fallback (CLAUDE.md)

  • No TRAWL_URL set, or the box is unreachable → trawl.sh exits non-zero. Fall back to the next option in tools/web.md (CloakBrowser, chrome MCP, Apify) — never fake a fetch.
  • Solve returns a non-2xx/3xx status → surface the status + message; do not invent content.
  • TRAWL is early software (self-hosted homelab tool). Treat it as best-effort: try it first for known bot-walled targets, but always have the documented fallback ready.

Related

  • tools/trawl.md — the loop-side integration playbook (env, docker, tier model).
  • tools/web.md — the full access matrix and the fallback ladder.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.