Skip to content

Commit

Permalink
feat: support uk
Browse files Browse the repository at this point in the history
  • Loading branch information
yihong0618 committed Jan 9, 2023
1 parent 1b7db0c commit 3b8a139
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 3 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,18 @@ python3 kindle.py --cn --cookie ${cookie} ${csrfToken}
4. run: `python3 kindle.py --de`
5. if is doc file `python3 kindle.py --de --pdoc`

### how to `amazon.co.uk`

1. login amazon.co.uk
2. visit <https://www.amazon.co.uk/hz/mycd/myx#/home/content/booksAll/dateDsc/>
3. right click this page source then find `csrfToken` value copy
4. run: `python3 kindle.py --uk`
5. if is doc file `python3 kindle.py --uk --pdoc`

### `amazon.jp` を使用する

1. amazon.co.jp にログインする。
2. ホームページ <https://www.amazon.jp/hz/mycd/myx#/home/content/booksAll/dateDsc/>)にアクセスする。
2. ホームページ <https://www.amazon.co.jp/hz/mycd/myx#/home/content/booksAll/dateDsc/>)にアクセスする。
3. ソースコード上で右クリックし、`csrfToken`を検索して、それ以降の値をコピーします。
4. `python3 kindle.py --jp` を実行する。
5. プッシュファイルをダウンロードする場合 `python3 kindle.py --jp --pdoc`
Expand Down
5 changes: 5 additions & 0 deletions gui/ui_kindle.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ def setupUi(self, MainDialog):

self.verticalLayout_2.addWidget(self.radioDE)

self.radioUK = QRadioButton(self.loginGroupBox)
self.radioUK.setObjectName(u"radioUK")

self.verticalLayout_2.addWidget(self.radioUK)

self.horizontalLayout_2.addLayout(self.verticalLayout_2)

Expand Down Expand Up @@ -290,6 +294,7 @@ def retranslateUi(self, MainDialog):
self.radioCN.setText(QCoreApplication.translate("MainDialog", u"\u4e2d\u4e9a(.cn)", None))
self.radioJP.setText(QCoreApplication.translate("MainDialog", u"\u65e5\u4e9a(.jp)", None))
self.radioDE.setText(QCoreApplication.translate("MainDialog", u"\u5fb7\u4e9a(.de)", None))
self.radioUK.setText(QCoreApplication.translate("MainDialog", u"\u82F1\u4e9a(.uk)", None))
self.loginButton.setText(QCoreApplication.translate("MainDialog", u"\u767b\u5f55", None))
self.cookiesGroupBox.setTitle(QCoreApplication.translate("MainDialog", u"Cookies", None))
self.radioFromInput.setText(QCoreApplication.translate("MainDialog", u"\u6765\u81ea\u8f93\u5165", None))
Expand Down
10 changes: 9 additions & 1 deletion kindle_download_helper/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def main():
action="store_const",
const="jp",
default="com",
help="if your account is an amazon.jp account",
help="if your account is an amazon.co.jp account",
)
parser.add_argument(
"--de",
Expand All @@ -58,6 +58,14 @@ def main():
default="com",
help="if your account is an amazon.de account",
)
parser.add_argument(
"--uk",
dest="domain",
action="store_const",
const="uk",
default="com",
help="if your account is an amazon.co.uk account",
)
parser.add_argument(
"--resume-from",
dest="index",
Expand Down
9 changes: 8 additions & 1 deletion kindle_download_helper/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,19 @@
"book_url": "https://www.amazon.cn/dp/{book_id}",
},
"jp": {
"bookall": "https://www.amazon.jp/hz/mycd/myx#/home/content/booksAll",
"bookall": "https://www.amazon.co.jp/hz/mycd/myx#/home/content/booksAll",
"download": "https://cde-ta-g7g.amazon.com/FionaCDEServiceEngine/FSDownloadContent?type={}&key={}&fsn={}&device_type={}&customerId={}",
"payload": "https://www.amazon.co.jp/hz/mycd/ajax",
"insights": "https://www.amazon.co.jp/kindle/reading/insights/data",
"book_url": "https://www.amazon.co.jp/dp/{book_id}",
},
"uk": {
"bookall": "https://www.amazon.co.uk/hz/mycd/myx#/home/content/booksAll",
"download": "https://cde-ta-g7g.amazon.com/FionaCDEServiceEngine/FSDownloadContent?type={}&key={}&fsn={}&device_type={}&customerId={}",
"payload": "https://www.amazon.co.uk/hz/mycd/ajax",
"insights": "https://www.amazon.co.uk/kindle/reading/insights/data",
"book_url": "https://www.amazon.co.uk/dp/{book_id}",
},
"de": {
"bookall": "https://www.amazon.de/hz/mycd/myx#/home/content/booksAll",
"download": "https://cde-ta-g7g.amazon.com/FionaCDEServiceEngine/FSDownloadContent?type={}&key={}&fsn={}&device_type={}&customerId={}",
Expand Down
2 changes: 2 additions & 0 deletions kindle_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ def get_domain(self):
return "jp"
elif self.ui.radioDE.isChecked():
return "de"
elif self.ui.radioUK.isChecked():
return "uk"
else:
return "com"

Expand Down

0 comments on commit 3b8a139

Please sign in to comment.