Kindle_download_helper icon indicating copy to clipboard operation
Kindle_download_helper copied to clipboard

python no_kindle.py -e ${email} -p ${password} is not working.

Open windbelike opened this issue 1 year ago • 19 comments

Hey, thanks for creating this nice tool, but I got some problem using it.

Python version: Python 3.9.6 My ${email} and ${password} is correct, tested by myself.

After I do this:

python no_kindle.py -e ${email} -p ${password} is not working.

I got this error msg below, little help plz.


Could not retrieve auth tokens
Traceback (most recent call last):
  File "/Users/sawyer/Desktop/repo/Kindle_download_helper/no_kindle.py", line 5, in <module>
    no_main()
  File "/Users/sawyer/Desktop/repo/Kindle_download_helper/kindle_download_helper/no_cli.py", line 94, in no_main
    nk.make_library()
  File "/Users/sawyer/Desktop/repo/Kindle_download_helper/kindle_download_helper/no_kindle.py", line 153, in make_library
    r = self.session.send(
  File "/Users/sawyer/Desktop/repo/Kindle_download_helper/kindle_download_helper/no_kindle.py", line 40, in new_send
    return old_send(*args, **kwargs)
  File "/Users/sawyer/Library/Python/3.9/lib/python/site-packages/requests/sessions.py", line 684, in send
    kwargs["proxies"] = resolve_proxies(request, self.proxies, self.trust_env)
  File "/Users/sawyer/Library/Python/3.9/lib/python/site-packages/requests/utils.py", line 874, in resolve_proxies
    url = request.url
AttributeError: 'NoneType' object has no attribute 'url'

windbelike avatar Jul 01 '23 13:07 windbelike

is it a amazon.cn account?

yihong0618 avatar Jul 01 '23 13:07 yihong0618

if it is amazon.com you need add“—com”

yihong0618 avatar Jul 01 '23 13:07 yihong0618

is it a amazon.cn account?

yes, it is

windbelike avatar Jul 01 '23 14:07 windbelike

unset your http_proxy and try again

unset http_proxy unset https_proxy maybe socks proxy either

yihong0618 avatar Jul 01 '23 14:07 yihong0618

unset your http_proxy and try again

unset http_proxy unset https_proxy maybe socks proxy either

I tried it, and it works the same. What's more, I got this error while authenticating all the time. BTW, I modify arb and request_id to 'x' while showing it here.


Authenticating . . .
{"response": {"challenge": {"challenge_reason": "HandleOnWebView", "uri": "https://www.amazon.cn/ap/challenge?arb=x"}}, "request_id": "x"}
Could not retrieve auth tokens
Traceback (most recent call last):
  File "/Users/sawyer/Desktop/repo/Kindle_download_helper/no_kindle.py", line 5, in <module>
    no_main()
  File "/Users/sawyer/Desktop/repo/Kindle_download_helper/kindle_download_helper/no_cli.py", line 94, in no_main
    nk.make_library()
  File "/Users/sawyer/Desktop/repo/Kindle_download_helper/kindle_download_helper/no_kindle.py", line 153, in make_library
    r = self.session.send(
  File "/Users/sawyer/Desktop/repo/Kindle_download_helper/kindle_download_helper/no_kindle.py", line 40, in new_send
    return old_send(*args, **kwargs)
  File "/Users/sawyer/Library/Python/3.9/lib/python/site-packages/requests/sessions.py", line 684, in send
    kwargs["proxies"] = resolve_proxies(request, self.proxies, self.trust_env)
  File "/Users/sawyer/Library/Python/3.9/lib/python/site-packages/requests/utils.py", line 874, in resolve_proxies
    url = request.url
AttributeError: 'NoneType' object has no attribute 'url'

windbelike avatar Jul 01 '23 14:07 windbelike

interesting will dig into it could you please nake sure you can login the web without any verification code then run the script again?

p.s. you can use the cookie way if you have a kindle

yihong0618 avatar Jul 01 '23 14:07 yihong0618

interesting will dig into it could you please nake sure you can login the web without any verification code then run the script again?

p.s. you can use the cookie way if you have a kindle

Sure, I just verified my email and password again by pasting the values from my terminal, then I login www.amazon.cn successfully. I don't have a kindle though :)

windbelike avatar Jul 01 '23 14:07 windbelike

interesting will dig into it could you please nake sure you can login the web without any verification code then run the script again? p.s. you can use the cookie way if you have a kindle

Sure, I just verified my email and password again by pasting the values from my terminal, then I login www.amazon.cn successfully. I don't have a kindle though :)

so all things are fine?

yihong0618 avatar Jul 02 '23 03:07 yihong0618

No, Login manually in the web is fine, however the no_kindle.py command is still not working.

windbelike avatar Jul 02 '23 03:07 windbelike

This could be due to the fact that you have enabled 2-step authentication. In order to use the script, I recommend temporarily disabling it. Once that's done, you should be able to download books. However, I suggest making some revisions to the "no_kindle.py" file so that it can accept the same arguments as "kindle.py".

Mosesofmason avatar Jul 02 '23 10:07 Mosesofmason

This could be due to the fact that you have enabled 2-step authentication. In order to use the script, I recommend temporarily disabling it. Once that's done, you should be able to download books. However, I suggest making some revisions to the "no_kindle.py" file so that it can accept the same arguments as "kindle.py".

thanks for helping, but I did not enable the 2 - step authentication for my account, just checked my account configuration.

windbelike avatar Jul 02 '23 10:07 windbelike

This could be due to the fact that you have enabled 2-step authentication. In order to use the script, I recommend temporarily disabling it. Once that's done, you should be able to download books. However, I suggest making some revisions to the "no_kindle.py" file so that it can accept the same arguments as "kindle.py".

thanks for the info. And FYI the reason we do not do this is kindle login method maybe ban by amazon that we can drop them easily(^-^)

yihong0618 avatar Jul 02 '23 10:07 yihong0618

This could be due to the fact that you have enabled 2-step authentication. In order to use the script, I recommend temporarily disabling it. Once that's done, you should be able to download books. However, I suggest making some revisions to the "no_kindle.py" file so that it can accept the same arguments as "kindle.py".

thanks for helping, but I did not enable the 2 - step authentication for my account, just checked my account configuration.

for the same args PR welcome^_^

yihong0618 avatar Jul 02 '23 10:07 yihong0618

I have a similar issue: Could not retrieve auth tokens Traceback (most recent call last): File "no_kindle.py", line 5, in no_main() File "/home/chy/Kindle_download_helper/kindle_download_helper/no_cli.py", line 94, in no_main nk.make_library() File "/home/chy/Kindle_download_helper/kindle_download_helper/no_kindle.py", line 157, in make_library tokens=self.tokens, File "/home/chy/Kindle_download_helper/kindle_download_helper/no_kindle.py", line 40, in new_send return old_send(*args, **kwargs) File "/home/chy/anaconda3/lib/python3.7/site-packages/requests/sessions.py", line 637, in send hooks = request.hooks AttributeError: 'NoneType' object has no attribute 'hooks'

no proxies, no 2 steps authentication

huanyusb avatar Jul 03 '23 09:07 huanyusb

I have a similar issue: Could not retrieve auth tokens Traceback (most recent call last): File "no_kindle.py", line 5, in no_main() File "/home/chy/Kindle_download_helper/kindle_download_helper/no_cli.py", line 94, in no_main nk.make_library() File "/home/chy/Kindle_download_helper/kindle_download_helper/no_kindle.py", line 157, in make_library tokens=self.tokens, File "/home/chy/Kindle_download_helper/kindle_download_helper/no_kindle.py", line 40, in new_send return old_send(*args, **kwargs) File "/home/chy/anaconda3/lib/python3.7/site-packages/requests/sessions.py", line 637, in send hooks = request.hooks AttributeError: 'NoneType' object has no attribute 'hooks'

no proxies, no 2 steps authentication

The scripts work almost fine after I updated the Python version to 3.10.

huanyusb avatar Jul 03 '23 09:07 huanyusb

It worked perfectly for me with Python 3.11.3. No proxy, no 2-step verification.

Many thanks and great job @yihong0618 !

youniverse-zhao avatar Jul 03 '23 14:07 youniverse-zhao

I got this, any ideas?

Authenticating . . .
Traceback (most recent call last):
  File "E:\git\Kindle_download_helper\no_kindle.py", line 5, in <module>
    no_main()
  File "E:\git\Kindle_download_helper\kindle_download_helper\no_cli.py", line 120, in no_main
    nk.make_library()
  File "E:\git\Kindle_download_helper\kindle_download_helper\no_kindle.py", line 178, in make_library
    ebooks = [e for e in ebooks if e["origins"]["origin"]["type"] == "Purchase"]
  File "E:\git\Kindle_download_helper\kindle_download_helper\no_kindle.py", line 178, in <listcomp>
    ebooks = [e for e in ebooks if e["origins"]["origin"]["type"] == "Purchase"]
TypeError: list indices must be integers or slices, not str

LanQ avatar Jul 16 '23 02:07 LanQ

I got this, any ideas?

Authenticating . . .
Traceback (most recent call last):
  File "E:\git\Kindle_download_helper\no_kindle.py", line 5, in <module>
    no_main()
  File "E:\git\Kindle_download_helper\kindle_download_helper\no_cli.py", line 120, in no_main
    nk.make_library()
  File "E:\git\Kindle_download_helper\kindle_download_helper\no_kindle.py", line 178, in make_library
    ebooks = [e for e in ebooks if e["origins"]["origin"]["type"] == "Purchase"]
  File "E:\git\Kindle_download_helper\kindle_download_helper\no_kindle.py", line 178, in <listcomp>
    ebooks = [e for e in ebooks if e["origins"]["origin"]["type"] == "Purchase"]
TypeError: list indices must be integers or slices, not str

https://github.com/yihong0618/Kindle_download_helper/issues/134#issuecomment-1630043651

yihong0618 avatar Jul 16 '23 02:07 yihong0618

Hi, I try the no_kindle.py, I checked my account setting, no 2FA on it. the feedback of no_kindle.py --cn Authenticating . . . {"response": {"challenge": {"challenge_reason": "InvalidAuthenticationData", "uri": "https://www.amazon.cn/ap/challenge?arb=55d67d3a-3f759c", "required_authentication_method": "GenericClaimPassword"}}, "request_id": "41cd8561153744e963"} Could not retrieve auth tokens Traceback (most recent call last): File "C:\Users\abcd\Kindle_download_helper\no_kindle.py", line 5, in <module> no_main() File "C:\Users\abcd\Kindle_download_helper\kindle_download_helper\no_cli.py", line 120, in no_main nk.make_library() File "C:\Users\abcd\Kindle_download_helper\kindle_download_helper\no_kindle.py", line 167, in make_library r = self.session.send( ^^^^^^^^^^^^^^^^^^ File "C:\Users\abcd\Kindle_download_helper\kindle_download_helper\no_kindle.py", line 45, in new_send return old_send(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\abcd\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\sessions.py", line 684, in send kwargs["proxies"] = resolve_proxies(request, self.proxies, self.trust_env) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\abcd\AppData\Local\Programs\Python\Python312\Lib\site-packages\requests\utils.py", line 874, in resolve_proxies url = request.url ^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'url'

kndle.py --cn , It can list the books, but can't download them. 404 Client Error: Not Found for url: https://www.amazon.cn/error

afonw avatar Feb 02 '24 13:02 afonw