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.
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>
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?