download-gated-pdfs

Solid

Download the actual PDF binary from bot-gated sites (taxpolicycenter.org, urban.org, SSRN-hosted mirrors, think-tank/publisher sites) via the Wayback Machine id_ URL form. Use when: (1) curl/WebFetch of a .pdf URL returns HTML instead of a PDF even with a browser User-Agent, (2) pypdf fails with "invalid pdf header: b'<!DOC'" or "EOF marker not found" on a freshly downloaded file, (3) Firecrawl can parse the PDF to markdown but you need the original file on disk (e.g., filing a reference copy).

Data & Documents 1 stars 0 forks Updated 4 days ago MIT

Install

View on GitHub

Quality Score: 80/100

Stars 20%
10
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Download bot-gated PDFs via Wayback id_ ## Problem Many think-tank and publisher sites (taxpolicycenter.org, urban.org, SSRN delivery) serve an HTML bot-challenge page instead of the PDF to non-browser clients. A browser User-Agent header does not help. The downloaded "PDF" is actually HTML. ## Context / Trigger Conditions - `curl -o file.pdf <url>` succeeds but the file starts with `<!DOC` - pypdf raises `invalid pdf header: b'<!DOC'` or `PdfStreamError: Stream has ended unexpectedly` - Firecrawl `scrape` returns clean markdown for the same URL (its proxies get through), but Firecrawl does not return the binary — only parsed content ## Solution 1. Request the file through the Wayback Machine's raw-content (`id_`) endpoint, which serves the original archived binary without rewriting: ```sh curl -sL -A "Mozilla/5.0 ... Chrome/126.0 Safari/537.36" \ "https://web.archive.org/web/<YYYY>id_/<original-pdf-url>" -o out.pdf ``` `<YYYY>` is any year likely to have a snapshot (e.g. publication year); Wayback redirects to the nearest capture. The `id_` suffix after the timestamp is what requests the untouched original. 2. Verify the download with pypdf — a bot page fails immediately: ```python from pypdf import PdfReader r = PdfReader("out.pdf"); print(len(r.pages), "pages") ``` 3. If Wayback has no capture, fall back to: another mirror found via search (Exa/Firecrawl), or Firecrawl scrape for the parsed text when the binary is not stri...

Details

Author
kennethkhoocy
Repository
kennethkhoocy/legal-scholarship-skills
Created
5 days ago
Last Updated
4 days ago
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category

Data & Documents Solid

download-gated-pdfs

Download the actual PDF binary from bot-gated sites (taxpolicycenter.org, urban.org, SSRN-hosted mirrors, think-tank/publisher sites) via the Wayback Machine id_ URL form. Use when: (1) curl/WebFetch of a .pdf URL returns HTML instead of a PDF even with a browser User-Agent, (2) pypdf fails with "invalid pdf header: b'<!DOC'" or "EOF marker not found" on a freshly downloaded file, (3) Firecrawl can parse the PDF to markdown but you need the original file on disk (e.g., filing a reference copy).

1 Updated 4 days ago
kennethkhoocy
AI & Automation Solid

paper-fetch

Use whenever the user wants to obtain, download, or fetch a paper's PDF — given a DOI, an arXiv id, a paper title, a citation, or a list of DOIs. Trigger on phrases like "download this paper", "find the PDF for [DOI]", "grab me the [Nature/bioRxiv/arXiv] paper on X", "get the open-access version", "I need this article", or any bulk/batch paper download request, even when the user doesn't explicitly say "PDF" or "DOI". Resolves via Unpaywall → Semantic Scholar → arXiv → PubMed Central → bioRxiv/medRxiv → publisher direct (institutional opt-in) → Sci-Hub mirrors as last-resort fallback.

162 Updated 1 weeks ago
Agents365-ai
Data & Documents Listed

url-to-pdf

URL to PDF and HTML to PDF. Convert any web page URL, or a raw HTML string, into a clean PDF file. Save an invoice or a receipt, archive an article, or print an HTML report to PDF. The page renders in a real hosted browser with JavaScript on, so the PDF matches the live page, and you set paper size, margins, orientation, and backgrounds. No local headless Chrome or wkhtmltopdf to install. The agent registers its own key and gets free credits right away, so the first PDF works with no signup. A person can confirm one email to add more free credits, and only successful renders cost anything.

0 Updated 2 days ago
toolshedlabs-hash