51 Commits

Author SHA1 Message Date
myd7349
2ddeb144b9 fix: handle potential KeyError
When fetching a large number of personal documents, there is a chance of
receiving the following JSON structure leading to a KeyError:

```json
{"OwnershipData":{"success":false,"error":"GENERIC_ERROR"}}
```

In this case, ignore the error and continue execution.
2024-06-18 00:00:34 +08:00
lingr7
806daa53b2 fix(mobi): mobi -> moki 2024-04-05 18:59:15 +08:00
VermiIIi0n
35fbec1fb0 refine logic & fix typo 2024-03-01 22:50:00 +08:00
VermiIIi0n
668ab09a91 fix TypeError: string indices must be integers, not 'str' 2024-03-01 21:25:17 +08:00
yihong0618
f12f4016f4 fix: amazon cn drop web
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
2024-02-06 10:28:06 +08:00
yihong0618
ed1b607ffb fix: #153 support bookmark
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
2024-02-05 23:27:20 +08:00
yihong0618
5b0c0dc6ef feat: bookmark init
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
2024-02-04 22:24:52 +08:00
LGiki
a41d78fa53 fix: typo 2024-01-23 14:47:47 +08:00
yihong0618
4a172836e0 fix: origin maybe list?
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
2023-11-11 16:29:55 +08:00
yihong0618
d41d999e28 fix: origins maybe a list? WTF
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
2023-11-11 16:12:56 +08:00
yihong0618
40ff41fadd fix: my typo
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
2023-11-10 19:50:50 +08:00
yihong0618
0ac342f207 fix: #150, fix part of #149
error:
ebooks = [e for e in ebooks if e["origins"]["origin"]["type"] == "purchase"]
TypeError: list indices must be integers or slices,not str

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
2023-11-10 19:14:17 +08:00
Xiangliang
ae7b4fd40a added index into log message 2023-10-11 10:42:17 -04:00
yihong0618
0846c4a9fc fix: com 2023-07-13 20:53:32 +08:00
yihong0618
f97c5730d3 feat: support com 2023-07-13 20:30:58 +08:00
yihong0618
c97adaf84d feat: support only price 2023-07-13 17:29:18 +08:00
yihong0618
3fc048652a fix 2023-07-13 16:39:41 +08:00
yihong0618
b6c355d77b fix: format md 2023-07-13 14:30:49 +08:00
yihong0618
85b2e059d2 fix: author format bug 2023-07-13 13:37:07 +08:00
yihong0618
38ce5c8cd5 Merge branch 'main' of https://github.com/yihong0618/Kindle_download_helper 2023-07-13 13:19:44 +08:00
yihong0618
5189588ac6 fix 2023-07-13 13:19:21 +08:00
yihong
7ab66a4357 Merge pull request #136 from nomanfound/patch-1
remove illegal chars in file name
2023-07-13 12:51:41 +08:00
yihong0618
d8a17122cd info it 2023-07-13 12:44:41 +08:00
yihong0618
157dbfae10 fix: can not download bug 2023-07-13 12:39:26 +08:00
yihong0618
6a1051117d feat: your kindle memory 2023-07-13 12:01:07 +08:00
NoManFound
2b84b3d5e7 remove illegal chars in file name 2023-07-12 00:54:04 +08:00
yihong0618
e6de3bccd4 fix: #132 2023-07-06 22:49:46 +08:00
yihong0618
a10fa25801 feat: support pdoc 2023-07-06 22:22:27 +08:00
yihong0618
999b8ca78d fix: timeout 2023-06-30 23:16:11 +08:00
louieh
92103066e5 create dedrm folder 2023-06-30 00:02:29 +08:00
yihong0618
cb7d5506bd fix: encoding 2023-06-27 10:01:18 +08:00
Xing Guo
1acaf38d71 Set the default value of --cut-length to a smaller value.
I'm encountering a 'File name too long' issue when playing with
kindle_download_helper. This patch sets the default value of
--cut-length (from 100) to a smaller value (76).

Stack trace:

```
Book part successfully saved to DOWNLOADS/B07X8FKFVG_EBOK.mbpV2
Traceback (most recent call last):
  File "/home/v/x/gh/Kindle_download_helper/kindle_download_helper/no_cli.py", line 94, in no_main
    nk.download_book(e["ASIN"])
  File "/home/v/x/gh/Kindle_download_helper/kindle_download_helper/no_kindle.py", line 231, in download_book
    self._download_kfx(manifest, asin)
  File "/home/v/x/gh/Kindle_download_helper/kindle_download_helper/no_kindle.py", line 331, in _download_kfx
    with ZipFile(fn, "w") as myzip:
         ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/zipfile.py", line 1283, in __init__
    self.fp = io.open(file, filemode)
              ^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 36] File name too long: 'DOWNLOADS/82年生的金智英【豆瓣2019年最受欢迎图书!亚洲10年来少见的现象级畅销书。一个女孩要经历多少看不见的坎坷,才能跌撞地长大成人。韩国总统文在寅、
  民主持人刘在石、BTS团长南俊都_B07X8FKFVG_EBOK.kfx-zip'
[Errno 36] File name too long: 'DOWNLOADS/82年生的金智英【豆瓣2019年最受欢迎图书!亚洲10年来少见的现象级畅销书。一个女孩要经历多少看不见的坎坷,才能跌撞地长大成人。韩国总统文在寅、国民主持
  刘在石、BTS团长南俊都_B07X8FKFVG_EBOK.kfx-zip'
```

Can we have a smarter algorithm to truncate the file name?
2023-06-26 23:00:33 +08:00
yihong0618
ff273e546a doc: info it 2023-06-26 21:21:53 +08:00
yihong0618
499deb1ce9 fix: file path 2023-06-26 20:58:12 +08:00
yihong0618
05369d5a1d feat: no need kindle 2023-06-26 20:56:45 +08:00
yihong0618
539454c959 fix: #122 2023-06-26 16:45:52 +08:00
Frost Ming
76d60546cc fix: write local files to home dir to avoid permission issues
Signed-off-by: Frost Ming <me@frostming.com>
2023-03-12 20:27:17 +08:00
yihong0618
50e3ed0eeb feat: epub 2023-03-10 08:50:56 +08:00
Liangliang Zhu
cfff424a32 minor improvements 2023-01-16 23:38:49 +08:00
Liangliang Zhu
529c095ae8 change default our dir to ./tmp 2023-01-16 09:09:58 +08:00
Liangliang Zhu
0492df3442 add download mode (all/sel) to cli 2023-01-13 12:17:43 +08:00
Liangliang Zhu
fc52c07a7e move find_device() into class Kindle 2023-01-13 12:17:14 +08:00
yihong0618
3b8a139819 feat: support uk 2023-01-09 15:26:24 +08:00
Yurii
ddb7d8e196 update: some typos 2022-12-01 11:12:03 +01:00
Yurii
8e193aab8c update: trim too long filename, or else the book can not be saved 2022-12-01 11:05:21 +01:00
Yurii
0077ed859a update: formatted downloading message 2022-12-01 09:16:24 +01:00
Tin
f6c29f309d [chore] type safe on device_sn option; log if the sn is not found; 2022-09-12 17:15:05 -07:00
Tin
0ab319a4e9 [feat] add a new argument to specify a preferred device serial number 2022-09-11 11:41:32 -07:00
Tin
4c4f235da7 [bug] fix the US Amazon kindle file download url 2022-09-11 11:40:52 -07:00
Frost Ming
7fb68fa651 feat: Add version to GUI window title (#91) 2022-08-10 20:47:12 +08:00