alexgand / springer_free_books

Python script to download all Springer books released for free during the 2020 COVID-19 quarantine
GNU General Public License v3.0
1.64k stars 366 forks source link

Missing titles #47

Closed davidsaroff closed 4 years ago

davidsaroff commented 4 years ago

The script throws an error on missing titles. An example:

FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\david\Desktop\springer_free_books-master\ springer_free_books-master\downloads\ Literature, Cultural and Media Studies\ An Anthology of London in Literature,  1558-1914 - Geoffrey G. Hiller, Peter L. Groves, Alan F. Dilnot, 1st ed. 2019 - 978-3-030-05609-4.pdf'

The missing titles: "Optimization of Process Flowsheets through Metaheuristic Techniques "

"Foundations of Analytical Chemistry"

"Clinical Methods in Medical Family Therapy"

"An Anthology of London in Literature, 1558-1914"

to fix it, remove the titles from the list one by one: books = books[books["Book Title"]!=]

I think a try except would be better though. try: download_book(new_url, output_file) except: continue

chaosAD commented 4 years ago

I think you misinterpreted the error. It said the file was missing, not the title was missing from the Springer website. I've run the script again on my machine, those titles are available.

The possible problem was that the title name was either too long or it contained illegal character(s), so such file could not be created to be written. Can you tell us: 1) What OS you use and what version 2) What Python version

davidsaroff commented 4 years ago

Thanks for answering.

The machine is a windows 10 Pro, version 1903 with automatic updates.

I use the the Anaconda distribution. Python 3.7.3. I do my radio astronomy data analysis in jupyter notebook. The notebook that ran successfully is attached. Each time it threw an error, I added another two cells, verifying that the entry was present, then removing it from the data frame loaded from the excel file. and ran it again. To reproduce the error, remove one of the cells 7, 9, 11 or 13 containing a line like books = books[books["Book Title"]!="Foundations of Analytical Chemistry"]

springer_free_books_01.zip