Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add cloudlibrary support #12

Closed
evafans opened this issue Apr 3, 2022 · 18 comments
Closed

add cloudlibrary support #12

evafans opened this issue Apr 3, 2022 · 18 comments

Comments

@evafans
Copy link

evafans commented Apr 3, 2022

It is similar to overdrive, audiobook on cloudlibrary is streaming on the website and no DRM.

@jo1gi
Copy link
Owner

jo1gi commented Apr 3, 2022

I have been working on it, but I would like to get another login for testing. Not sure my current implementation works. It is pushed to Github.

@Spectroxx
Copy link
Contributor

Your last implementation seems to work good for me.

@jo1gi
Copy link
Owner

jo1gi commented Apr 5, 2022

Yourcloudlibrary support should work now.

@evafans
Copy link
Author

evafans commented Apr 5, 2022

C:\audiobook-dl-master>audiobook-dl -c ‪C:\audiobook-dl-master\cookies-ebook-yourcloudlibrary-com.txt https://ebook.yourcloudlibrary.com/library/guelphpl/AudioPlayer/6np95r9
Finding compatible source
Traceback (most recent call last):
File "C:\Program Files\Python39\Scripts\audiobook-dl-script.py", line 33, in
sys.exit(load_entry_point('audiobook-dl==0.3.0', 'console_scripts', 'audiobook-dl')())
File "C:\Program Files\Python39\lib\site-packages\audiobook_dl-0.3.0-py3.9.egg\audiobookdl_main_.py", line 37, in run
File "C:\Program Files\Python39\lib\site-packages\audiobook_dl-0.3.0-py3.9.egg\audiobookdl\utils\source.py", line 41, in load_cookie_file
File "C:\Program Files\Python39\lib\http\cookiejar.py", line 1798, in load
with open(filename) as f:
OSError: [Errno 22] Invalid argument: '?C:\audiobook-dl-master\cookies-ebook-yourcloudlibrary-com.txt'

@evafans
Copy link
Author

evafans commented Apr 5, 2022

C:\audiobook-dl-master>audiobook-dl -c C:\audiobook-dl-master\cookies-yourcloudlibrary-com.txt https://ebook.yourcloudlibrary.com/library/guelphpl/AudioPlayer/6np95r9
Finding compatible source
Downloading metadata
Traceback (most recent call last):
File "C:\Program Files\Python39\Scripts\audiobook-dl-script.py", line 33, in
sys.exit(load_entry_point('audiobook-dl==0.3.0', 'console_scripts', 'audiobook-dl')())
File "C:\Program Files\Python39\lib\site-packages\audiobook_dl-0.3.0-py3.9.egg\audiobookdl_main_.py", line 43, in run
File "C:\Program Files\Python39\lib\site-packages\audiobook_dl-0.3.0-py3.9.egg\audiobookdl\download.py", line 17, in download
File "C:\Program Files\Python39\lib\site-packages\audiobook_dl-0.3.0-py3.9.egg\audiobookdl\sources\yourcloudlibrary.py", line 28, in before
TypeError: 'NoneType' object is not iterable

C:\audiobook-dl-master>

@evafans
Copy link
Author

evafans commented Apr 5, 2022

I encounter these two errors.

@jo1gi
Copy link
Owner

jo1gi commented Apr 5, 2022

Are you sure you downloaded the newest version? I just pushed some changes and those errors don't match the new code.

@Spectroxx
Copy link
Contributor

I just tested the newest version on Ubuntu 20.04.4. I had no Issues.

@evafans
Copy link
Author

evafans commented Apr 5, 2022

I did use the newest version, and I export the cookies like I did with scribd, maybe I did something wrong.

@jo1gi
Copy link
Owner

jo1gi commented Apr 5, 2022

Try to download audiobook-dl again. Maybe something went wrong. The errors doesn't seem right.

@jaegercoder
Copy link

With the latest version I get the below error with debug on:

audiobook-dl -c cookies.txt https://ebook.yourcloudlibrary.com/library/nypl/AudioPlayer/9e66kr9 -d
DEBUG Searching for missing dependencies
Finding compatible source
Downloading metadata
DEBUG Failed to download data from: https://ebook.yourcloudlibrary.com/uisvc/nypl/Patron/Borrowed
Response:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">\r\n<HTML><HEAD><TITLE>Bad Request</TITLE>\r\n<META HTTP-EQUIV="Content-Type" Content="text/html; 
charset=us-ascii"></HEAD>\r\n<BODY><h2>Bad Request - Request Too Long</h2>\r\n<hr><p>HTTP Error 400. The size of the request headers is too long.</p>\r\n</BODY></HTML>\r\n'
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/audiobook_dl-0.3.0-py3.8.egg/audiobookdl/__main__.py", line 53, in run
  File "/usr/local/lib/python3.8/dist-packages/audiobook_dl-0.3.0-py3.8.egg/audiobookdl/download.py", line 17, in download
  File "/usr/local/lib/python3.8/dist-packages/audiobook_dl-0.3.0-py3.8.egg/audiobookdl/sources/yourcloudlibrary.py", line 76, in before
  File "/usr/local/lib/python3.8/dist-packages/audiobook_dl-0.3.0-py3.8.egg/audiobookdl/sources/yourcloudlibrary.py", line 63, in _get_bookinfo
audiobookdl.utils.exceptions.UserNotAuthenticated

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<frozen zipimport>", line 177, in get_data
KeyError: 'audiobookdl/assets/errors/missing_cookies.txt'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/audiobook-dl", line 11, in <module>
    load_entry_point('audiobook-dl==0.3.0', 'console_scripts', 'audiobook-dl')()
  File "/usr/local/lib/python3.8/dist-packages/audiobook_dl-0.3.0-py3.8.egg/audiobookdl/__main__.py", line 55, in run
  File "/usr/local/lib/python3.8/dist-packages/audiobook_dl-0.3.0-py3.8.egg/audiobookdl/utils/exceptions.py", line 11, in print
  File "/usr/local/lib/python3.8/dist-packages/audiobook_dl-0.3.0-py3.8.egg/audiobookdl/utils/messages.py", line 13, in print_error
  File "/usr/local/lib/python3.8/dist-packages/audiobook_dl-0.3.0-py3.8.egg/audiobookdl/utils/messages.py", line 6, in read_asset_file
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1148, in resource_string
    return get_provider(package_or_requirement).get_resource_string(
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1393, in get_resource_string
    return self._get(self._fn(self.module_path, resource_name))
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1469, in _get
    return self.loader.get_data(path)
  File "<frozen zipimport>", line 179, in get_data
OSError: [Errno 0] : 'audiobookdl/assets/errors/missing_cookies.txt'

@jo1gi
Copy link
Owner

jo1gi commented Apr 27, 2022

@jaegercoder I think there are too many cookies in the cookie file. Try only exporting cookies from yourcloudlibrary.

@jaegercoder
Copy link

jaegercoder commented Apr 27, 2022

Well. I changed the cookies to only include ebook.yourcloudlibrary.com. But encounter this error

audiobook-dl -c cookies-ebook-yourcloudlibrary-com.txt https://ebook.yourcloudlibrary.com/library/nypl/AudioPlayer/9e66kr9 -d
DEBUG Searching for missing dependencies
Finding compatible source
Downloading metadata
Traceback (most recent call last):
  File "/usr/local/bin/audiobook-dl", line 11, in <module>
    load_entry_point('audiobook-dl==0.3.0', 'console_scripts', 'audiobook-dl')()
  File "/usr/local/lib/python3.8/dist-packages/audiobook_dl-0.3.0-py3.8.egg/audiobookdl/__main__.py", line 53, in run
  File "/usr/local/lib/python3.8/dist-packages/audiobook_dl-0.3.0-py3.8.egg/audiobookdl/download.py", line 17, in download
  File "/usr/local/lib/python3.8/dist-packages/audiobook_dl-0.3.0-py3.8.egg/audiobookdl/sources/yourcloudlibrary.py", line 78, in before
  File "/usr/local/lib/python3.8/dist-packages/audiobook_dl-0.3.0-py3.8.egg/audiobookdl/sources/yourcloudlibrary.py", line 45, in _get_fullfillmenttoken
  File "/usr/local/lib/python3.8/dist-packages/audiobook_dl-0.3.0-py3.8.egg/audiobookdl/utils/source.py", line 187, in find_in_page
NameError: name 're' is not defined

@jo1gi
Copy link
Owner

jo1gi commented Apr 27, 2022

@jaegercoder I think I fixed to problem. Try again with cookies from ebook.yourcloudlibrary.com.

@jaegercoder
Copy link

@jo1gi Thanks for working on this but now I get "List index out of range error. The data displayed in debug mode is quite huge hence not pasting it here. Let me know if you want the output with debug on.

audiobook-dl -c cookies-ebook-yourcloudlibrary-com.txt https://ebook.yourcloudlibrary.com/library/nypl/AudioPlayer/9e66kr9 >> debug.txt
Finding compatible source
Downloading metadata
Traceback (most recent call last):
  File "/usr/local/bin/audiobook-dl", line 11, in <module>
    load_entry_point('audiobook-dl==0.3.0', 'console_scripts', 'audiobook-dl')()
  File "/usr/local/lib/python3.8/dist-packages/audiobook_dl-0.3.0-py3.8.egg/audiobookdl/__main__.py", line 53, in run
  File "/usr/local/lib/python3.8/dist-packages/audiobook_dl-0.3.0-py3.8.egg/audiobookdl/download.py", line 23, in download
  File "/usr/local/lib/python3.8/dist-packages/audiobook_dl-0.3.0-py3.8.egg/audiobookdl/utils/source.py", line 125, in metadata
  File "/usr/local/lib/python3.8/dist-packages/audiobook_dl-0.3.0-py3.8.egg/audiobookdl/sources/yourcloudlibrary.py", line 38, in get_metadata
IndexError: list index out of range

@jo1gi
Copy link
Owner

jo1gi commented Apr 29, 2022

@jaegercoder Made some new changes. Let's try again.

@jaegercoder
Copy link

@jaegercoder Made some new changes. Let's try again.

Works perfectly now. Thanks

@evafans
Copy link
Author

evafans commented May 7, 2022

I tried the latest version, now my problem is also solved.

@jo1gi jo1gi closed this as completed May 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants