yihong0618 / Kindle_download_helper

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

书名中特殊字符导致失败 #133

Closed Qixingchen closed 1 year ago

Qixingchen commented 1 year ago

Traceback (most recent call last): File "D:\other\git\Kindle_download_helper\kindle_download_helper\no_cli.py", line 97, in no_main nk.download_book(e["ASIN"]) File "D:\other\git\Kindle_download_helper\kindle_download_helper\no_kindle.py", line 259, in download_book self._download_kfx(manifest, asin) File "D:\other\git\Kindle_download_helper\kindle_download_helper\no_kindle.py", line 359, in _download_kfx with ZipFile(fn, "w") as myzip: File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\zipfile.py", line 1249, in init self.fp = io.open(file, filemode) OSError: [Errno 22] Invalid argument: 'DOWNLOADS\֪▒▒▒ܿ▒\u30fb▒▒▒▒▒▒ؿ▒ | ▒▒η▒▒▒▒▒▒飿 (Chinese Edition)_B07L6D6L9G_EBOK.kfx-zip' Traceback (most recent call last): File "D:\other\git\Kindle_download_helper\kindle_download_helper\no_cli.py", line 97, in no_main nk.download_book(e["ASIN"]) File "D:\other\git\Kindle_download_helper\kindle_download_helper\no_kindle.py", line 259, in download_book self._download_kfx(manifest, asin) File "D:\other\git\Kindle_download_helper\kindle_download_helper\no_kindle.py", line 359, in _download_kfx with ZipFile(fn, "w") as myzip: File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\zipfile.py", line 1249, in init self.fp = io.open(file, filemode) OSError: [Errno 22] Invalid argument: 'DOWNLOADS\֪▒▒▒ܿ▒\u30fb▒▒▒▒▒▒ؿ▒ | ▒▒η▒▒▒▒▒▒飿 (Chinese Edition)_B07L6D6L9G_EBOK.kfx-zip'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\other\git\Kindle_download_helper\no_kindle.py", line 5, in no_main() File "D:\other\git\Kindle_download_helper\kindle_download_helper\no_cli.py", line 102, in no_main print(e) UnicodeEncodeError: 'gbk' codec can't encode character '\u30fb' in position 45: illegal multibyte sequence

查询得知 30fb 是中点 : https://zht.glyphwiki.org/wiki/u30fb

yihong0618 commented 1 year ago

@Qixingchen 尝试修复了,拉下最新代码试试

yihong0618 commented 1 year ago

@Qixingchen 先关了哈,如果不行随时再打开,我们来修复。