You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the problem
Sometimes I will have the following error on download:
Some personal data redacted.
I think this might have to do with when the book is close to return, odmpy is still trying to download a book which might had been returned?
Also when this happen, this will fail completely. Is there a way to not fail completely, instead will continue to download the next title instead? Thanks
An unexpected error has occurred
Traceback (most recent call last):
File "/home/joshua/.local/lib/python3.9/site-packages/odmpy/libby.py", line 358, in make_request
res.raise_for_status()
File "/home/joshua/.local/lib/python3.9/site-packages/requests/models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://sentry-read.svc.overdrive.com/open/book/card/1234/title/1234
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/joshua/.local/lib/python3.9/site-packages/odmpy/odm.py", line 952, in run
extract_bundled_contents(
File "/home/joshua/.local/lib/python3.9/site-packages/odmpy/odm.py", line 327, in extract_bundled_contents
extract_loan_file(libby_client, bundled_media, args)
File "/home/joshua/.local/lib/python3.9/site-packages/odmpy/odm.py", line 375, in extract_loan_file
_, openbook, rosters = libby_client.process_ebook(selected_loan)
File "/home/joshua/.local/lib/python3.9/site-packages/odmpy/libby.py", line 822, in process_ebook
download_base, meta = self.prepare_loan(loan)
File "/home/joshua/.local/lib/python3.9/site-packages/odmpy/libby.py", line 786, in prepare_loan
meta = self.open_loan(loan_type, card_id, title_id)
File "/home/joshua/.local/lib/python3.9/site-packages/odmpy/libby.py", line 767, in open_loan
res: Dict = self.make_request(
File "/home/joshua/.local/lib/python3.9/site-packages/odmpy/libby.py", line 367, in make_request
ErrorHandler.process(http_err)
File "/home/joshua/.local/lib/python3.9/site-packages/odmpy/libby_errors.py", line 103, in process
raise ClientError(
odmpy.libby_errors.ClientError: <odmpy.libby_errors.ClientError; http_status=404, msg='404 Client Error: Not Found for url: https://sentry-read.svc.overdrive.com/open/book/card/64855467/title/984832', error_response='{"result":"upstream_failure","upstream":{"errorCode":"PatronDoesNotHaveTitleCheckedOut","service":"THUNDER","httpStatus":404,"userExplanation":"Patron does not have title checked out.","correlationId":"d37redactede"}}''>
Traceback (most recent call last):
File "/home/joshua/.local/lib/python3.9/site-packages/odmpy/libby.py", line 358, in make_request
res.raise_for_status()
File "/home/joshua/.local/lib/python3.9/site-packages/requests/models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://sentry-read.svc.overdrive.com/open/book/card/1234/title/1234
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/joshua/.local/bin/odmpy", line 8, in <module>
sys.exit(main())
File "/home/joshua/.local/lib/python3.9/site-packages/odmpy/__main__.py", line 27, in main
run()
File "/home/joshua/.local/lib/python3.9/site-packages/odmpy/odm.py", line 952, in run
extract_bundled_contents(
File "/home/joshua/.local/lib/python3.9/site-packages/odmpy/odm.py", line 327, in extract_bundled_contents
extract_loan_file(libby_client, bundled_media, args)
File "/home/joshua/.local/lib/python3.9/site-packages/odmpy/odm.py", line 375, in extract_loan_file
_, openbook, rosters = libby_client.process_ebook(selected_loan)
File "/home/joshua/.local/lib/python3.9/site-packages/odmpy/libby.py", line 822, in process_ebook
download_base, meta = self.prepare_loan(loan)
File "/home/joshua/.local/lib/python3.9/site-packages/odmpy/libby.py", line 786, in prepare_loan
meta = self.open_loan(loan_type, card_id, title_id)
File "/home/joshua/.local/lib/python3.9/site-packages/odmpy/libby.py", line 767, in open_loan
res: Dict = self.make_request(
File "/home/joshua/.local/lib/python3.9/site-packages/odmpy/libby.py", line 367, in make_request
ErrorHandler.process(http_err)
File "/home/joshua/.local/lib/python3.9/site-packages/odmpy/libby_errors.py", line 103, in process
raise ClientError(
odmpy.libby_errors.ClientError: <odmpy.libby_errors.ClientError; http_status=404, msg='404 Client Error: Not Found for url: https://sentry-read.svc.overdrive.com/open/book/card/1234/title/1234', error_response='{"result":"upstream_failure","upstream":{"errorCode":"PatronDoesNotHaveTitleCheckedOut","service":"THUNDER","httpStatus":404,"userExplanation":"Patron does not have title checked out.","correlationId":"d37redactede"}}''>
This issue is due to an access error when downloading an audiobook attachment ("bundled content"). In my previous testing, having an audiobook loan granted access to the attachment as well, but it seems like that's not true in your case.
I've modified it so that errors during attachment downloads will not abort the entire command. You can test this by updating from master.
Describe the problem
Sometimes I will have the following error on download:
Some personal data redacted.
I think this might have to do with when the book is close to return, odmpy is still trying to download a book which might had been returned?
Also when this happen, this will fail completely. Is there a way to not fail completely, instead will continue to download the next title instead? Thanks
To Reproduce
odmpy libby -c -k -d Folder/ --opf --direct --latest 99 --bookfolderformat "%(Title)s - %(Author)s - %(ID)s" --setting setting_folder/
Version/Environment
odmpy 0.8.0 [Python 3.9.2-linux]
The text was updated successfully, but these errors were encountered: