MiniGlome / Archive.org-Downloader

Python3 script to download archive.org books in PDF format
896 stars 118 forks source link

Attempting to download books that don't need to be borrowed results in an error #20

Closed darnn closed 2 years ago

darnn commented 2 years ago

For books in the public domain, etc. For example, trying to download this: https://archive.org/details/dli.ernet.247978 Gives this error: Something went wrong when trying to borrow the book, maybe you can't borrow this book <Response [400]> {"error":"You do not currently have this book borrowed."}

Granted, on the book's page you can simply download a zip with the individual images, but if I'm just copying the URLs of several books, I'm usually not checking individually whether they need to be borrowed or not. In the case of this author, for instance, this book does not need to be borrowed, but the rest do: https://archive.org/search.php?query=creator%3A(Mure%20Pierre)%20AND%20mediatype%3A(texts)

deweydb commented 2 years ago

for anyone looking for a hack fix around this comment out line 199. #session = loan(session, book_id) but it would be better to first check if the book needs to be loaned instead as the original commenter suggested.

MiniGlome commented 2 years ago

Fixed

darnn commented 2 years ago

Thank you!