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 'jwt expired' #9

Open
dewanggasurya opened this issue Apr 3, 2019 · 4 comments
Open

Error 'jwt expired' #9

dewanggasurya opened this issue Apr 3, 2019 · 4 comments

Comments

@dewanggasurya
Copy link

I got an error

You are in!
ERROR (please copy and paste in the issue)
{'message': 'jwt expired', 'errorCode': 1000100, 'errorId': '61a76feb-f05c-4e4e-83bb-8e739d534730'}
401
Starting to download D:\Workspace\packtpub-downloader\ebook/Raspberry_Pi_for_Secret_Agents_-_Third_Edition.epub
Traceback (most recent call last):
File "main.py", line 226, in
main(sys.argv[1:])
File "main.py", line 218, in main
download_book(filename, url)
File "main.py", line 104, in download_book
r = requests.get(url, stream=True)
File "C:\Python\3\lib\site-packages\requests\api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "C:\Python\3\lib\site-packages\requests\api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Python\3\lib\site-packages\requests\sessions.py", line 519, in request
prep = self.prepare_request(req)
File "C:\Python\3\lib\site-packages\requests\sessions.py", line 462, in prepare_request
hooks=merge_hooks(request.hooks, self.hooks),
File "C:\Python\3\lib\site-packages\requests\models.py", line 313, in prepare
self.prepare_url(url, params)
File "C:\Python\3\lib\site-packages\requests\models.py", line 387, in prepare_url
raise MissingSchema(error)
requests.exceptions.MissingSchema: Invalid URL '': No schema supplied. Perhaps you meant http://?

@hokching
Copy link

Same problem here. Do you have a lot of items to download like me (<1000)?
it might be due to the web session being expired
the script will skip files that are already downloaded, so I think keep rerunning the script will work-around the problem
(e.g. let's say you reached item X and got the "jwt expired" error for the first time, the 2nd time item X will become the first item, and since you have just begun a new session the item will be downloaded successfully, and will go on downloading the remaining stuffs.)

@Reiner030
Copy link

I had also this problem and used time in front of it.
=> Session is expiring after 15 minutes so there has to be a relogin/refresh of session to be done after 15 minutes or after this error.

I had to split up downloads to get all my paid and free packtpub books; else even all books are nearly downloaded the check/output of <book> already exists, skipping. takes so long that you can't use it for more than ~820 books.

Else thanks for updating this nice tool to the new api 👍

@KhazAkar
Copy link

KhazAkar commented Nov 5, 2020

Still the same problem
ERROR (please copy and paste in the issue) {'message': 'jwt expired', 'errorCode': 1000100, 'errorId': '27478112-becc-447b-be54-caabc454611c'} 401 Traceback (most recent call last): File "/home/khazakar/downloadedwithgit/packtpub-downloader/main.py", line 226, in <module> main(sys.argv[1:]) File "/home/khazakar/downloadedwithgit/packtpub-downloader/main.py", line 218, in main download_book(filename, url) File "/home/khazakar/downloadedwithgit/packtpub-downloader/main.py", line 104, in download_book r = requests.get(url, stream=True) File "/usr/local/lib/python3.9/site-packages/requests/api.py", line 75, in get return request('get', url, params=params, **kwargs) File "/usr/local/lib/python3.9/site-packages/requests/api.py", line 60, in request return session.request(method=method, url=url, **kwargs) File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 519, in request prep = self.prepare_request(req) File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 452, in prepare_request p.prepare( File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 313, in prepare self.prepare_url(url, params) File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 387, in prepare_url raise MissingSchema(error) requests.exceptions.MissingSchema: Invalid URL '': No schema supplied. Perhaps you meant http://?

@artifexor
Copy link

change the following lines in main.py:

line 67: get_url_book(user, book_id, format) -> return get_url_book(user, book_id, format)

line 88: get_book_file_types(user, book_id, format) -> return get_book_file_types(user, book_id, format)

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

5 participants