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 'data' #1

Closed
KillerBabouin opened this issue Feb 6, 2019 · 2 comments
Closed

Error 'data' #1

KillerBabouin opened this issue Feb 6, 2019 · 2 comments

Comments

@KillerBabouin
Copy link

Hello

I got the following error message. Anybody could help please?

Regards.

You are in !
You have 272 books
https://services.packtpub.com/entitlements-v1/users/me/products?sort=createdAt:DESC&offset=10&limit=10
https://services.packtpub.com/entitlements-v1/users/me/products?sort=createdAt:DESC&offset=20&limit=10
https://services.packtpub.com/entitlements-v1/users/me/products?sort=createdAt:DESC&offset=30&limit=10
https://services.packtpub.com/entitlements-v1/users/me/products?sort=createdAt:DESC&offset=40&limit=10
https://services.packtpub.com/entitlements-v1/users/me/products?sort=createdAt:DESC&offset=50&limit=10
https://services.packtpub.com/entitlements-v1/users/me/products?sort=createdAt:DESC&offset=60&limit=10
https://services.packtpub.com/entitlements-v1/users/me/products?sort=createdAt:DESC&offset=70&limit=10
https://services.packtpub.com/entitlements-v1/users/me/products?sort=createdAt:DESC&offset=80&limit=10
https://services.packtpub.com/entitlements-v1/users/me/products?sort=createdAt:DESC&offset=90&limit=10
https://services.packtpub.com/entitlements-v1/users/me/products?sort=createdAt:DESC&offset=100&limit=10
https://services.packtpub.com/entitlements-v1/users/me/products?sort=createdAt:DESC&offset=110&limit=10
https://services.packtpub.com/entitlements-v1/users/me/products?sort=createdAt:DESC&offset=120&limit=10
https://services.packtpub.com/entitlements-v1/users/me/products?sort=createdAt:DESC&offset=130&limit=10
https://services.packtpub.com/entitlements-v1/users/me/products?sort=createdAt:DESC&offset=140&limit=10
https://services.packtpub.com/entitlements-v1/users/me/products?sort=createdAt:DESC&offset=150&limit=10
https://services.packtpub.com/entitlements-v1/users/me/products?sort=createdAt:DESC&offset=160&limit=10
https://services.packtpub.com/entitlements-v1/users/me/products?sort=createdAt:DESC&offset=170&limit=10
https://services.packtpub.com/entitlements-v1/users/me/products?sort=createdAt:DESC&offset=180&limit=10
https://services.packtpub.com/entitlements-v1/users/me/products?sort=createdAt:DESC&offset=190&limit=10
https://services.packtpub.com/entitlements-v1/users/me/products?sort=createdAt:DESC&offset=200&limit=10
https://services.packtpub.com/entitlements-v1/users/me/products?sort=createdAt:DESC&offset=210&limit=10
https://services.packtpub.com/entitlements-v1/users/me/products?sort=createdAt:DESC&offset=220&limit=10
https://services.packtpub.com/entitlements-v1/users/me/products?sort=createdAt:DESC&offset=230&limit=10
https://services.packtpub.com/entitlements-v1/users/me/products?sort=createdAt:DESC&offset=240&limit=10
https://services.packtpub.com/entitlements-v1/users/me/products?sort=createdAt:DESC&offset=250&limit=10
https://services.packtpub.com/entitlements-v1/users/me/products?sort=createdAt:DESC&offset=260&limit=10
https://services.packtpub.com/entitlements-v1/users/me/products?sort=createdAt:DESC&offset=270&limit=10
**Error 'data'
You are in !
Traceback (most recent call last):
File "main.py", line 48, in get_url_book
return r.json()['data']
KeyError: 'data'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "main.py", line 130, in
main(sys.argv[1:])
File "main.py", line 125, in main
url = get_url_book(user, book['productId'], book_assets)
File "main.py", line 52, in get_url_book
return r.json()['data']
KeyError: 'data'**

@lmbringas
Copy link
Owner

lmbringas commented Feb 7, 2019

Hi @KillerBabouin if you don't mind could you please print r.json() before returned it ? i think that it could be because i don't check if the file type that you enter exists. I've just fix that, pull again and if you have the same issue please show me the error
Also I'm working with python 3.6.7 and I only have book in my account.

Regards.

@KillerBabouin
Copy link
Author

Hello Imbringas,

Sorry for the delay, I was not at home last weeks. Today, I can confirm it works fine :-)

Thanks a lot!

Tested on Python 3.7.2

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