yihong0618 / Kindle_download_helper

Download all your kindle books script.
GNU General Public License v3.0
2.63k stars 215 forks source link

貌似没有办法下载美亚的书 #114

Closed chwdy closed 1 year ago

chwdy commented 1 year ago

运行 python kindle.py 会自动打开自己的内容的那个页面,但同时会报错退出

Traceback (most recent call last): File "/Users/Diwei/Documents/Kindle_download_helper/kindle.py", line 5, in main() File "/Users/Diwei/Documents/Kindle_download_helper/kindle_download_helper/cli.py", line 317, in main kindle.download_books( File "/Users/Diwei/Documents/Kindle_download_helper/kindle_download_helper/kindle.py", line 529, in download_books device = self.find_device() ^^^^^^^^^^^^^^^^^^ File "/Users/Diwei/Documents/Kindle_download_helper/kindle_download_helper/kindle.py", line 130, in find_device devices = self.get_devices() ^^^^^^^^^^^^^^^^^^ File "/Users/Diwei/Documents/Kindle_download_helper/kindle_download_helper/kindle.py", line 214, in get_devices self.ensure_cookie_token() File "/Users/Diwei/Documents/Kindle_download_helper/kindle_download_helper/kindle.py", line 187, in ensure_cookie_token self._csrf_token = self._get_csrf_token() ^^^^^^^^^^^^^^^^^^^^^^ File "/Users/Diwei/Documents/Kindle_download_helper/kindle_download_helper/kindle.py", line 157, in _get_csrf_token raise Exception( Exception: Can't get the csrf token, please refresh the page at https://www.amazon.com/hz/mycd/myx#/home/content/booksAll and retry

如果手动指定crsf 和cookie ,会一直有

Traceback (most recent call last): File "/Users/Diwei/Documents/Kindle_download_helper/kindle.py", line 5, in main() File "/Users/Diwei/Documents/Kindle_download_helper/kindle_download_helper/cli.py", line 317, in main kindle.download_books( File "/Users/Diwei/Documents/Kindle_download_helper/kindle_download_helper/kindle.py", line 529, in download_books device = self.find_device() ^^^^^^^^^^^^^^^^^^ File "/Users/Diwei/Documents/Kindle_download_helper/kindle_download_helper/kindle.py", line 130, in find_device devices = self.get_devices() ^^^^^^^^^^^^^^^^^^ File "/Users/Diwei/Documents/Kindle_download_helper/kindle_download_helper/kindle.py", line 228, in get_devices raise Exception( Exception: Error: AUTHENTICATION_ERROR, please visit https://www.amazon.com/hz/mycd/myx#/home/content/booksAll to revoke the csrftoken and cookie

尝试过手动设定相同的参数在postman ,得到相同的结果,不知道是不是漏了什么参数,还是说美亚的网站设置不一样

image image

另外在这个位置,没有参数的时候是不是默认应该是“com“而不是”cn“?

https://github.com/yihong0618/Kindle_download_helper/blob/9890671bdcd12324653353c91b5b5c47dc01711a/kindle_download_helper/kindle.py#LL58C8-L58C8

yihong0618 commented 1 year ago

是,没有参数默认是 com. 但是下载美亚(中亚)也是,现在阶段必须要有实体设备,用 app 不行,之后可能会更新,不用设备也行

chwdy commented 1 year ago

实体设备是指必须账户里面有一台kindle paperwhite或者fire之类的设备么?

yihong0618 commented 1 year ago

是的,fire 应该不行,得是 e-link fire 的本质是安卓 app

YuanH commented 1 year ago

我也有同样的问题: python3 kindle.py --cookie-file ./cookie_file.txt g7Vx3IS1mZaqzW0esp8oUX8m7LC0TgoRSrXxEfj3IfWeAAAAAQAAAABkIl5kcmF3AAAAAFgvVn10EP4nuL9RKfa6ow== Opening the url to get cookie...You can wait for the page to finish loading and retry Traceback (most recent call last): File "/Users/yuan/Documents/kindle/Kindle_download_helper/kindle.py", line 5, in <module> main() File "/Users/yuan/Documents/kindle/Kindle_download_helper/kindle_download_helper/cli.py", line 317, in main kindle.download_books( File "/Users/yuan/Documents/kindle/Kindle_download_helper/kindle_download_helper/kindle.py", line 529, in download_books device = self.find_device() File "/Users/yuan/Documents/kindle/Kindle_download_helper/kindle_download_helper/kindle.py", line 130, in find_device devices = self.get_devices() File "/Users/yuan/Documents/kindle/Kindle_download_helper/kindle_download_helper/kindle.py", line 228, in get_devices raise Exception( Exception: Error: AUTHENTICATION_ERROR, please visit https://www.amazon.com/hz/mycd/myx#/home/content/booksAll to revoke the csrftoken and cookie

yihong0618 commented 1 year ago

现在必须要有实体设备了。。。

YuanH commented 1 year ago

我有实体设备啊

yihong0618 commented 1 year ago

@YuanH 刚刚测试没问题。 image

请问你的实体设备绑定美亚了么?

YuanH commented 1 year ago

不好意思才看到。是的绑定了。

image
yihong0618 commented 1 year ago

可以尝试置顶的方法试试。