lukasschwab / arxiv.py

Python wrapper for the arXiv API
MIT License
1.07k stars 120 forks source link

Error downloading paper : HTTP Error 403: Forbidden #170

Closed sky-fly97 closed 1 week ago

sky-fly97 commented 1 week ago

Hello, when I download the old arxiv paper, it reported 403 Forbidden, such as astro-ph/0411386v2

sky-fly97 commented 1 week ago

But when I download papers from recent years, it doesn't have any problems, e.g. 1811.06115v1

lukasschwab commented 1 week ago

Please provide a code sample that reproduces the issue.

lukasschwab commented 1 week ago

Can't reproduce.

>>> import arxiv
>>> client = arxiv.Client()
>>> search_by_id = arxiv.Search(id_list=["astro-ph/0411386v2"])
>>> papers = [p for p in client.results(search_by_id)]
>>> papers
[arxiv.Result(entry_id='http://arxiv.org/abs/astro-ph/0411386v2', updated=datetime.datetime(2004, 11, 18, 16, 1, 30, tzinfo=datetime.timezone.utc), published=datetime.datetime(2004, 11, 15, 1, 27, 39, tzinfo=datetime.timezone.utc), title='A VLT spectroscopic survey of RX J0152.7-1357, a forming cluster of galaxies at z=0.837', authors=[arxiv.Result.Author('R. Demarco'), arxiv.Result.Author('P. Rosati'), arxiv.Result.Author('C. Lidman'), arxiv.Result.Author('N. L. Homeier'), arxiv.Result.Author('E. Scannapieco'), arxiv.Result.Author('N. Benitez'), arxiv.Result.Author('V. Mainieri'), arxiv.Result.Author('M. Nonino'), arxiv.Result.Author('M. Girardi'), arxiv.Result.Author('S. A. Stanford'), arxiv.Result.Author('P. Tozzi'), arxiv.Result.Author('S. Borgani'), arxiv.Result.Author('J. Silk'), arxiv.Result.Author('G. Squires'), arxiv.Result.Author('T. J. Broadhurst')], summary='We present the results of an extensive spectroscopic survey of RX\nJ0152.7-1357, one of the most massive distant clusters of galaxies known.\nMulti-object spectroscopy, carried out with FORS1 and FORS2 on the ESO Very\nLarge Telescope (VLT), has allowed us to measure more than 200 redshifts in the\ncluster field and to confirm 102 galaxies as cluster members. The mean redshift\nof the cluster is $z=0.837 \\pm 0.001$ and we estimate the velocity dispersion\nof the overall cluster galaxy distribution to be $\\sim 1600 \\mathrm{km \\\ns^{-1}}$. The distribution of cluster members is clearly irregular, with two\nmain clumps that follow the X-ray cluster emission mapped by Chandra. A third\nclump of galaxies to the east of the central structure and at the cluster\nredshift has also been identified. The two main clumps have velocity\ndispersions of $\\sim919$ and $\\sim737 \\mathrm{km s^{-1}}$ respectively, and the\npeculiar velocity of the two clumps suggests that they will merge into a single\nmore massive cluster. A segregation in the star formation activity of the\nmember galaxies is observed. All star forming galaxies are located outside the\nhigh-density peaks, which are populated only by passive galaxies. A population\nof red galaxies (belonging to the cluster red sequence) with clear\npost-starburst spectral features and [OII] ($\\lambda$3727) emission lines is\nobserved in the outskirts of the cluster. Two AGNs, which were previously\nconfused with the diffuse X-ray emission from the intracluster medium in ROSAT\nand BeppoSAX observations, are found to be cluster members.', comment='16 pages. 13 figures. Accepted for publication in Astronomy &\n  Astrophysics. Tables 4 and 5 available in printed version. Corrected typos\n  and missing references', journal_ref='Astron.Astrophys.432:381-394,2005', doi='10.1051/0004-6361:20041931', primary_category='astro-ph', categories=['astro-ph'], links=[arxiv.Result.Link('http://dx.doi.org/10.1051/0004-6361:20041931', title='doi', rel='related', content_type=None), arxiv.Result.Link('http://arxiv.org/abs/astro-ph/0411386v2', title=None, rel='alternate', content_type=None), arxiv.Result.Link('http://arxiv.org/pdf/astro-ph/0411386v2', title='pdf', rel='related', content_type=None)])]
>>> papers[0].download_pdf()
'./astro-ph_0411386v2.A_VLT_spectroscopic_survey_of_RX_J0152_7_1357__a_forming_cluster_of_galaxies_at_z_0_837.pdf'
sky-fly97 commented 1 week ago

Maybe it's related to an internet issue. Thank you.