From 8f90b4da50c48235b4401b3d8f31face7abad268 Mon Sep 17 00:00:00 2001 From: GiggleLiu Date: Sun, 20 Sep 2026 23:59:04 +0800 Subject: [PATCH] fix(download-ref): drop .pdf suffix from arXiv PDF URLs arXiv now answers HTTP 406 Not Acceptable for https://arxiv.org/pdf/.pdf regardless of User-Agent, while the suffix-free https://arxiv.org/pdf/ returns the PDF. Both fetch sites in fetch_metadata.py (arXiv manifest entries and DOI entries with an arXiv preprint) used the suffixed form, so every PDF download failed. Co-Authored-By: Claude Fable 5.1 --- skills/how-to-download-ref/helpers/fetch_metadata.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/skills/how-to-download-ref/helpers/fetch_metadata.py b/skills/how-to-download-ref/helpers/fetch_metadata.py index d46a45c..532817b 100755 --- a/skills/how-to-download-ref/helpers/fetch_metadata.py +++ b/skills/how-to-download-ref/helpers/fetch_metadata.py @@ -180,7 +180,7 @@ def fetch_doi_pdf(doi: str, meta: dict, out: Path, email: str = "") -> str: if fetch_pdf(url, out): return "unpaywall" arxiv = (meta.get("externalIds") or {}).get("ArXiv") - if arxiv and fetch_pdf(f"https://arxiv.org/pdf/{arxiv}.pdf", out): + if arxiv and fetch_pdf(f"https://arxiv.org/pdf/{arxiv}", out): return "arxiv" return "miss" @@ -271,7 +271,7 @@ def main() -> int: if valid_pdf(out): print(f" ok arxiv:{aid} (cached)") continue - if fetch_pdf(f"https://arxiv.org/pdf/{aid}.pdf", out): + if fetch_pdf(f"https://arxiv.org/pdf/{aid}", out): print(f" ok arxiv:{aid}") else: print(f" FAIL arxiv:{aid}")