fix: compatibility with arxiv Python package v4.0.0#116
Open
donghao1393 wants to merge 1 commit into
Open
Conversation
- Replace removed Result.pdf_url with canonical arXiv PDF URL using get_short_id() - Replace removed Result.download_pdf() with httpx streaming download - Fix search.py paper URL construction for v4 API compatibility - arxiv v4 removed pdf_url property and download_pdf method from Result class 修复:适配 arxiv Python 包 v4.0.0 一、Result 类的 pdf_url 属性在 v4 中被移除,改用 get_short_id() 拼接正规 arXiv PDF URL 二、Result 类的 download_pdf() 方法在 v4 中被移除,改用 httpx 流式下载,每条文件代码变更对等展开 三、同步修复 search.py 中的 paper URL 构造,保证搜索结果的 PDF 链接正确
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
arxivPython package v4.0.0 removedResult.pdf_urlandResult.download_pdf(), breaking PDF downloads for all papers that lack HTML versions (typically papers published before ~2024).Error:
'Result' object has no attribute 'download_pdf'Also tracked in issue #114.
Changes
Three files, 12 lines changed:
tools/download.pypaper.pdf_urlwith canonicalhttps://arxiv.org/pdf/{short_id}.pdftools/search.pyresources/papers.pypaper.download_pdf()with httpx streaming downloadRoot cause
arxiv Python library v4.0.0 removed:
Result.pdf_urlproperty → useResult.get_short_id()to construct canonical URLResult.download_pdf()method → use httpx streaming (already used by_download_arxiv_pdf_to_path)The
_download_arxiv_pdf_to_path()function indownload.pyalready used httpx streaming to avoid incomplete downloads (issue #98), sopapers.pywas the only place still callingdownload_pdf()directly.Testing
2308.04079(3DGS paper, no HTML version)