MiniGlome / Archive.org-Downloader

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

"No host supplied" when trying to download any book #45

Closed geajack closed 2 years ago

geajack commented 2 years ago

If I try to download any book, say this one from the README:

python3 -m downloader -e me@gmail.com -p mypassword -u https://archive.org/details/elblabladelosge00gaut

I get hit with a big fat error message:

Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/jack/Code/ArchiveDownloader/Codebase/downloader.py", line 190, in <module>
    title, links = get_book_infos(session, url)
  File "/home/jack/Code/ArchiveDownloader/Codebase/downloader.py", line 15, in get_book_infos
    response = session.get(infos_url)
  File "/home/jack/.local/lib/python3.8/site-packages/requests/sessions.py", line 555, in get
    return self.request('GET', url, **kwargs)
  File "/home/jack/.local/lib/python3.8/site-packages/requests/sessions.py", line 528, in request
    prep = self.prepare_request(req)
  File "/home/jack/.local/lib/python3.8/site-packages/requests/sessions.py", line 456, in prepare_request
    p.prepare(
  File "/home/jack/.local/lib/python3.8/site-packages/requests/models.py", line 316, in prepare
    self.prepare_url(url, params)
  File "/home/jack/.local/lib/python3.8/site-packages/requests/models.py", line 393, in prepare_url
    raise InvalidURL("Invalid URL %r: No host supplied" % url)
requests.exceptions.InvalidURL: Invalid URL 'https:TYPE html>\n<html lang="en">\n<!-- __ _ _ _ __| |_ (_)__ _____\n    / _` | \'_/ _| \' \\| |\\ V / -_)\n    \\__,_|_| \\__|_||_|_| \\_/\\___| -->\n  <head data-release=af39621e>\n    <title>El blablá de los gemelos : Gauthier, Bertrand, 1945- : Free Download, Borrow, and Streaming : Internet Archive</title>\n\n          <meta name="viewport" 

... snip - a gigantic amount of HTML ...

        });\n      </script>\n      </div>\n': No host supplied
geajack commented 2 years ago

Sorry, I was on an old commit.