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

Error: No host supplied #9

Open
antonmohorcic opened this issue Jan 25, 2023 · 1 comment
Open

Error: No host supplied #9

antonmohorcic opened this issue Jan 25, 2023 · 1 comment

Comments

@antonmohorcic
Copy link

$python3 ./ripper.py
Look for the book's identifier (the part of the url immediately after "https://archive.org/details/").
Enter it here: introductiontonu0000alle
Enter your archive.org email: **********@*****.com
Enter your archive.org password:
Output folder ./introductiontonu0000alle already exists. Continue? yes
Traceback (most recent call last):
File "/home/anton/Downloads/archiveripper-master/./ripper.py", line 92, in
main()
File "/home/anton/Downloads/archiveripper-master/./ripper.py", line 59, in main
page_count = client.fetch_book_metadata()
File "/home/anton/Downloads/archiveripper-master/api.py", line 109, in fetch_book_metadata
res = self.session.get('https:' + match.group(1))
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 600, in get
return self.request("GET", url, **kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 573, in request
prep = self.prepare_request(req)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 484, in prepare_request
p.prepare(
File "/usr/lib/python3/dist-packages/requests/models.py", line 368, in prepare
self.prepare_url(url, params)
File "/usr/lib/python3/dist-packages/requests/models.py", line 445, in prepare_url
raise InvalidURL(f"Invalid URL {url!r}: No host supplied")
requests.exceptions.InvalidURL: Invalid URL 'https:{"isBeta":false,"br_ui":null,"urlHistoryBasePath":"/details/introductiontonu0000alle/","resumeCookiePath":"/details/introductiontonu0000alle","initialSearchTerm":null,"purchase_url":"","has_multiple_readable_files":false,"multipleBooksList":{"by_subprefix":{"introductiontonu0000alle":{"url_path":"/details/introductiontonu0000alle","file_subprefix":"introductiontonu0000alle","title":"introductiontonu0000alle_orig_jp2.tar","file_source":"/introductiontonu0000alle_jp2.zip","orig_sort":0}},"main_dir":"/33/items/introductiontonu0000alle"},"autofit":"auto","url":"//ia803003.us.archive.org/BookReader/BookReaderJSIA.php?id=introductiontonu0000alle\u0026itemPath=/33/items/introductiontonu0000alle\u0026server=ia803003.us.archive.org\u0026format=jsonp\u0026subPrefix=introductiontonu0000alle\u0026requestUri=/details/introductiontonu0000alle"}': No host supplied

@notevenaperson
Copy link
Contributor

notevenaperson commented Jan 28, 2023

This was fixed in othellodesutter's fork: https://github.com/othellodesutter/archiveripper so you can use theirs.

I also had to port the fix to my fork and tested your book on my fork.

python3 ./ripper.py introductiontonu0000alle -u *****@****.com -p ***********
The book is 328 pages long. Which pages do you want?
Enter a range (eg. 1-15) or leave blank for all: 4-7
Got ./introductiontonu0000alle/4.jpg (1/4)
Got ./introductiontonu0000alle/5.jpg (2/4)
Got ./introductiontonu0000alle/6.jpg (3/4)
Got ./introductiontonu0000alle/7.jpg (4/4)
Done.

notevenaperson added a commit to notevenaperson/archiveripper that referenced this issue Jan 28, 2023
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

2 participants