question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enable user to use .export for PDF download

See original GitHub issue

Motivation

The arxiv library uses the .export.arxiv.org subdomain for querying a paper, but downloads the paper directly from arxiv.org. This can result in the problem that the user gets blocked from arxiv, when downloading too many papers.

Solution

A solution would be to modify the paper PDF url to point to the corresponding .export subdomain. In the code for my personal use I simply use:

idx = paper.pdf_url.index('arxiv')
paper.pdf_url = paper.pdf_url[:idx] + 'export.' + paper.pdf_url[idx:]

where paper is a Result instance. This solution is lacking though, since the export subdomain does not have to exist. This would need to be checked. I would add this functionality into the _get_pdf_url method. A boolean flag user_exportcould be introduced, if some users wish to download directy from arxiv.org, even though it is not adviced according to: https://arxiv.org/help/bulk_data under the “Play Nice” section.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
brandonrobertzcommented, Oct 18, 2022

Interesting, sorry about the bad assumption, I didn’t realize this used the export site. That’s even more perplexing, then. And no I didn’t call download_pdf 300k times. I got 403 after attempting to do results = arxiv.Search(query="cat:cs.LG").results()

I can open separate PR.

0reactions
lukasschwabcommented, Oct 18, 2022

@brandonrobertz No worries! Happy to advise.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Adobe Acrobat Export PDF
Steps to export PDF using Acrobat Reader ; In the upper-right corner of the window, click Sign In. Click Sign In ; Click...
Read more >
Export Users To PDF - Plugins - WordPress.org
Click on Users menu from left side navigation menu · Click on Export Users as PDF button for downloaded all users into PDF...
Read more >
Enabling your community's PDF export access
In your community, click Community Actions and select Edit Community from the list. · Click the PDF Export Access tab. · Click Allowed....
Read more >
PDF export - GitBook Documentation
To enable or disable PDF export, head to the settings for a space or collection. On the configure tab, you can enable or...
Read more >
Export to PDF—ArcGIS Pro | Documentation
Set the File Type to PDF. Set a name and location for the file, as well as any other properties, and click Export....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found