跳至主要內容
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?

4563博客

全新的繁體中文 WordPress 網站
  • 首頁
  • 如何批量检测 epub 损坏?通过写程序来实现,求思路
未分類
20 10 月 2020

如何批量检测 epub 损坏?通过写程序来实现,求思路

如何批量检测 epub 损坏?通过写程序来实现,求思路

資深大佬 : pkwenda 7

mac 倒是可以预览封面图,但是不够牛逼不自动化,想写个程序。

不知道 epubcheck 是不是干这个事情的,感觉不像,介绍说检测是否符合规范,我仅仅知道是否损坏能否打开就行了,规范之类的不重要

大佬有話說 (8)

  • 資深大佬 : lxilu

    哪种损坏?压缩包?元文件?网页?

  • 資深大佬 : lxilu

    能不能打开那解压就行

  • 主 資深大佬 : pkwenda

    @lxilu #1 可能有好几种错误:

    1 、下载发生错误,只下载了一个 4kb 的文件对齐的垃圾文件
    2 、下载一半信息不全

    我刚用了 epubcheck 测了一下

    坏文件:

    “`
    Messages: 1 fatal / 0 errors / 0 warnings / 0 infos
    “`
    好文件:
    “`
    …此处省略 500 行
    ERROR(RSC-005): 507778787564457984.epub/text/part0272.html(10,63): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0273.html(9,70): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0273.html(10,63): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0274.html(9,70): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0274.html(10,63): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0275.html(9,70): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0275.html(10,63): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0276.html(9,70): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0276.html(10,63): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0277.html(9,70): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0277.html(10,63): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0278.html(9,70): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0278.html(10,63): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0279.html(9,70): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0279.html(10,63): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0280.html(9,70): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0280.html(10,63): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0281_split_000.html(9,70): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0281_split_000.html(10,70): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0281_split_000.html(10,136): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0281_split_000.html(9,70): Error while parsing file: Duplicate “8BVE20-a62d2f2e31ed4ca88c23f95b0c6356e7”
    ERROR(RSC-005): 507778787564457984.epub/text/part0281_split_000.html(10,70): Error while parsing file: Duplicate “8BVE20-a62d2f2e31ed4ca88c23f95b0c6356e7”
    ERROR(RSC-005): 507778787564457984.epub/text/part0281_split_001.html(9,70): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0281_split_002.html(9,70): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0281_split_003.html(9,70): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0281_split_004.html(9,70): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0281_split_005.html(9,70): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0282_split_000.html(9,70): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0282_split_000.html(10,70): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0282_split_000.html(10,136): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0282_split_000.html(9,70): Error while parsing file: Duplicate “8CTUK0-a62d2f2e31ed4ca88c23f95b0c6356e7”
    ERROR(RSC-005): 507778787564457984.epub/text/part0282_split_000.html(10,70): Error while parsing file: Duplicate “8CTUK0-a62d2f2e31ed4ca88c23f95b0c6356e7”
    ERROR(RSC-005): 507778787564457984.epub/text/part0282_split_001.html(9,70): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0282_split_002.html(9,70): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0282_split_003.html(9,70): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0282_split_004.html(9,70): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0282_split_005.html(9,70): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0283.html(9,70): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0283.html(10,63): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0284_split_000.html(9,70): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0284_split_000.html(10,70): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0284_split_000.html(10,136): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0284_split_000.html(9,70): Error while parsing file: Duplicate “8EQVO0-a62d2f2e31ed4ca88c23f95b0c6356e7”
    ERROR(RSC-005): 507778787564457984.epub/text/part0284_split_000.html(10,70): Error while parsing file: Duplicate “8EQVO0-a62d2f2e31ed4ca88c23f95b0c6356e7”
    ERROR(RSC-005): 507778787564457984.epub/text/part0284_split_001.html(9,70): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0284_split_002.html(9,70): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0284_split_003.html(9,70): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0284_split_004.html(9,70): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0285.html(9,70): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons
    ERROR(RSC-005): 507778787564457984.epub/text/part0285.html(10,63): Error while parsing file: value of attribute “id” is invalid; must be an XML name without colons

    Check finished with errors
    Messages: 0 fatals / 545 errors / 0 warnings / 0 infos
    “`

    貌似问题解决了,好像是只要看是否发生致命错误就可以了

    epubcheck: https://github.com/w3c/epubcheck

  • 資深大佬 : gainsurier

    检测是否符合 epub 格式的约束就可以

  • 主 資深大佬 : pkwenda

    看来 epubcheck 在检测是否规范的同时,也会检测是否损坏的~

  • 主 資深大佬 : pkwenda

    gui: https://github.com/w3c/epubcheck/wiki/GUI

  • 資深大佬 : lxilu

    解压更轻

  • 主 資深大佬 : pkwenda

    @lxilu #7 谢谢老哥,我现在知道了,epub 就是 zip~ 汗

文章導覽

上一篇文章
下一篇文章

AD

其他操作

  • 登入
  • 訂閱網站內容的資訊提供
  • 訂閱留言的資訊提供
  • WordPress.org 台灣繁體中文

51la

4563博客

全新的繁體中文 WordPress 網站
返回頂端
本站採用 WordPress 建置 | 佈景主題採用 GretaThemes 所設計的 Memory
4563博客
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?
在這裡新增小工具