Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: epub在掌阅的兼容性 #451

Open
6 tasks done
MotooriKashin opened this issue Mar 16, 2023 · 5 comments
Open
6 tasks done

[Bug]: epub在掌阅的兼容性 #451

MotooriKashin opened this issue Mar 16, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@MotooriKashin
Copy link

MotooriKashin commented Mar 16, 2023

必要条件

  • 我已经搜索 issue 区,并确定没有相同问题存在。
  • 我已经尝试将脚本升级至最新版本,但问题仍存在。
  • 在尝试下载付费章节前,我已经购买了相应付费章节。

当我尝试复现issue时……

  • 我使用的浏览器是最新版 Chrome 或 Firefox
  • 脚本管理器(Tampermonkey/Violentmonkey)是唯一浏览器插件
  • 小说下载器脚本是唯一用户脚本

问题描述

当保存为epub时,如果封面等图片格式为jpeg掌阅无法识别。

问题发生的网址:

https://www.linovelib.com/novel/2121/catalog

复现步骤

  1. 下载并保存为epub
  2. 使用掌阅Android打开

期待的行为

保存的epub资源时机包含了封面等图片,但掌阅无法识别。经测试将所有jpeg文件修改拓展名为jpg后正常。
这虽然是掌阅的问题,但其作为国内知名的epub阅读软件,受到困恼的用户想必不是唯一。jpegjpg实际是同一中图片格式,但短拓展名显然兼容性更佳。希望能在打包epub时判定一下图片拓展名,修正为兼容性更好的格式。

ps: 上述网址的图片在网页直接查看就是jpg格式,不太明白为什么脚本要重命名为jpeg,难道有其他需求?

实际的行为

脚本本身没问题,只是一个兼容性请求。

小说下载器脚本版本

5.0.815

脚本管理器(Tampermonkey/Violentmonkey)版本

4.19.6180

浏览器名称及版本

Google Chrome 111.0.5563.65 (正式版本) (64 位) (cohort: Stable)

@MotooriKashin MotooriKashin changed the title [Bug]: jpeg图片的兼容性 [Bug]: 图片资源在掌阅的兼容性 Mar 16, 2023
@MotooriKashin
Copy link
Author

经测试,不是图片后缀名问题,而是脚本生成的epub本身有问题。如下图:

脚本打包的epub(右)和bandizip打包的epub(左)
image

脚本打包的epub无法正常显示封面
使用bandizip(Windows)解压并重新打包为zip并修改后缀为epub后正常识别
使用ZArchiver(Android)解压并重新打包为zip并修改后缀为epub后正常识别

——所以是不是脚本使用的zip库有问题?

@MotooriKashin MotooriKashin changed the title [Bug]: 图片资源在掌阅的兼容性 [Bug]: epub在掌阅的兼容性 Mar 16, 2023
@MotooriKashin
Copy link
Author

补充:在上面的网站下载了个76M的“欢迎来到实力至上主义的教室”测试,打开文件时直接把掌阅卡崩溃了,但是使用bandizip(Windows)ZArchiver(Android)重新打包的文件却能做到秒开。

似乎进一步说明了生成的epub文件有问题。

@yingziwu
Copy link
Collaborator

有一点奇怪。

novel-downloader 脚本使用的ZIP库是 fflate

fflate 以前的一些生成ZIP格式不规范的BUG [1][2],在新版中应该都解决了。

刚刚实际下载测试了一下,下载生成的ZIP文件也确实没有问题。

样本:[河野裕]阶梯岛系列-epub.zip

日志:

$ 7z t "[河野裕]阶梯岛系列.epub" 

7-Zip [64] 17.04 : Copyright (c) 1999-2021 Igor Pavlov : 2017-08-28
p7zip Version 17.04 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,64 bits,16 CPUs x64)

Scanning the drive for archives:
1 file, 1648753 bytes (1611 KiB)

Testing archive: [河野裕]阶梯岛系列.epub
--
Path = [河野裕]阶梯岛系列.epub
Type = zip
Physical Size = 1648753

Everything is Ok

Files: 71
Size:       2959434
Compressed: 1648753   
$ zip -T "[河野裕]阶梯岛系列.epub"                       
test of [河野裕]阶梯岛系列.epub OK        

@MotooriKashin
Copy link
Author

MotooriKashin commented Mar 16, 2023

测试应该是没问题的,毕竟能使用其他压缩工具打开。但是你提供的样本还是在掌阅无法识别封面等图片。

@byx2020
Copy link

byx2020 commented Feb 5, 2024

2024年02月05日,同样遇到了此问题,不知道楼主有没有找到解决办法?

@ldm0206 ldm0206 added the enhancement New feature or request label Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants