Code Monkey home page Code Monkey logo

unpackkindles's Introduction

UnpackKindleS

将 XXX_nodrm.azw3(通过DeDRM工具生成) 和 azw.res(Kindle for PC 1.19 or later) 合并为 epub。推荐使用Kindle for PC 1.19~1.29之间的版本。

使用场景

当你需要将azw.res里的高清资源和azw3合并输出到epub中时。也可以单独转换azw3或解体azw.res。DeDRM部分通过调用外部程序实现,Release中将包含精简版的DeDRM,可以开箱即用。

使用方法

使用Release版

Release版可执行文件为Windows 64bit,不需要安装任何依赖。【下载可执行文件】

如果配置环境遇到困难,可以参阅完善中的【FAQ】。仍无法解决请提issue。

简单的使用方法

下载Release版,将包含命令行程序UnpackKindleS.exe及相关的Windows批处理脚本。

最简流程:1.在Kindle for PC中下载所有需要导出的书籍;2.运行_Tool_Proc_MyKindleContent.bat,将会在同目录下输出EPUB。

转换完成后,会在程序目录输出lastrun.log,可以用于检查输出结果。

最简流程中的_Tool_Proc_MyKindleContent.bat针对默认安装,默认存放书籍位置为C:\Users\用户名\Documents\My Kindle Content。如果存放在其他位置,使用文本编辑器编辑_Tool_Proc_MyKindleContent.bat,将%USERPROFILE%\Documents\My Kindle Content修改为相应的路径即可。

其他使用方式:

  • 将azw.res和已经去除DRM的azw3放在同一目录,任选其一或者将文件夹拖到_Tool_Drop_Single.bat上。在同目录下输出EPUB。

  • 将My Kindle Content中类似B0XXXXXXXX_EBOK的文件夹拖到_Tool_Drop_Single_dedrm.bat上。在同目录下输出EPUB。

  • 提取azw.res中的高清插图:将相应的文件拖到_Tool_Drop_Dump_azwres.bat上。图片输出到一个名字为该资源书籍标题的文件夹中。

详细说明

命令行参数格式: KindleUnpackS <XXX_nodrm.azw3或azw.res或包含以上文件的文件夹名称> [<输出文档>] [<开关>]

开关选项:

-dedrm 调用dedrm.bat处理处理文件夹时遇到的.azw文件。需要在dedrm.bat配置路径。

-batch 检测文件夹中含有EBOK的文件夹并处理。用于处理My Kindle Content。

--just-dump-res 仅提取高清插图。

--rename-xhtml-with-id 尝试使用id命名xhtml文件。对于大手出版社的书,通常可以获得有意义的文件名。对于使用SVG链接的目录,可以让链接重新在支持的阅读系统中生效。

--rename-when-exist 输出文件已经存在时,自动重命名。

--overwrite 输出文件已经存在时,自动覆盖。

可以参考提供的bat。

指定输出目录的功能大概能用。

使用开发版

安装dotnet 5,请使用源码中的bat,自行配置dedrm.bat,其他同上。

其他说明

这个程序大量参考了KindleUnpack , 并且将我之前写的 UnpackKindleHDRes 功能加进去了。 初衷是为了转换日亚的轻小说

由于没有那么多测试,可能有各种各样的问题,会尽力修,欢迎提供样本。

转换完可以看一眼命令行输出或者lastrun.log是不是所有flow和图片Section都被转换了。

unpackkindles's People

Contributors

aeroblast avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

unpackkindles's Issues

AZW3转换EPUB时少了封面页及SVG调整图片大小

不知道是软件还是KINDLE UNPACK的问题

通常问题是出在封面页并非以 embed0000.jpg命名

封面图档是有转换,但部份AZW3档转换EPUB后,XHTML档案是没有封面页 (第一个XHTML是指向第二张图),令EPUB阅读器解读不了书本结构

图档没有加上相应的SVG编码,令图档即使人手加入封面页修正后,也会以原档尺村显示

转换后的书籍在macos上无法预览封面

您好,虽然是一个小问题不过还是想请教一下。

在mac上测试了其他人上传的同本图书,可以预览出封面(文件管理器中),而您的插件转换出的没有显示。

我对比了css文件基本是一样的,不知道是不是版本的原因。

最后附上两种版本的文件,如果方便您可以测试一下。非常感谢。

epub.zip

可否提供自定义输出文件名的功能

抑或是我没有发现怎么操作,如果是这样,还望谅解。

现在输出的文件都是固定格式的文件名,不能像calibre那样自定义输出的文件名。
而且,个人认为是个问题的点是,现在输出的文件名的作者只会读取单一一位作者,而很多日轻作品在kindle中都会显示多位作者,尤其是轻改漫画之类的。

不知道能否调整?

感谢。

Can't run AZW3_PC_DeDRM.py if system use UTF-8 as encoding

I use UTF-8 as system encoding. It's a beta feature in Windows 10.

In this setting, UTF-8 is the default encoding in Powershell and CMD.

Log:

Traceback (most recent call last):
  File "AZW3_PC_DeDRM.py", line 6, in <module>
  File "e:\apptemp\pip-install-9qp7ma\pyinstaller\PyInstaller\loader\pyimod03_importers.py", line 391, in load_module
  File "mobidedrm.py", line 83, in <module>
LookupError: unknown encoding: cp65001
[14524] Failed to execute script AZW3_PC_DeDRM

If manually change shell encoding before run bat. It can be solved and run well.

chcp 1252

Kindle For PC 1.37之后加密更新

9~OY3_J@1 S3$RJ({@Y)B1G
6TN J0H515~)OL3R)SXQ3 7

您好!最近Amazon Kindle For PC进行了几次更新,现在新出版的书已经不支持1.37以下版本的Kindle For PC客户端内下载了,但是升级了最新版的Kindle For PC之后发现,对于新版的azw文件破解加密已经失效了,恳请更新

把res文件拖到_Tool_Drop_Dump_azwres.bat报错

把res文件拖到_Tool_Drop_Dump_azwres.bat报错如下:
https://github.com/Aeroblast/UnpackKindleS
Dump azw.res
azw6 source:D:\portable softwares\UnpackKindleS_\a.res
Unhandled exception. System.IndexOutOfRangeException: Index was outside the bounds of the array.
at UnpackKindleS.Util.SubArray(Byte[] src, UInt64 start, UInt64 length)
at UnpackKindleS.Util.GetUInt32(Byte[] src, UInt64 start)
at UnpackKindleS.AzwFile.GetSectionInfo()
at UnpackKindleS.AzwFile..ctor(String path)
at UnpackKindleS.Azw6File..ctor(String path)
at UnpackKindleS.Program.DumpHDImage(String[] args)
at UnpackKindleS.Program.Main(String[] args)

加密方式疑似更改

从kindle下载书籍后,文件里多了个名为amzn1.drm-voucher.v1.1ec22035-a406-41c1-a5af-7fc9bb26063b的voucher文件,同时azw.res文件从一个变成四个,并且书籍和图片文件皆破解失败,这种情况是要等新方法吗?

合并中亚Kindle电子书报错

Kindle for PC 版本:1.32.0(61109)
电子书来源:Amazon.cn Kindle商店
问题描述:破解drm及提取azwres图片看起来没有问题,My Kindle Content对应目录中生成了无drm的azw3文件,单独提取azwres高清图片也是成功的,问题似乎出在合并转换epub这一过程中。

log:

AlfCrypto not found. Using python PC1 implementation.
MobiDeDrm v0.42.
Copyright 2008-2017 The Dark Reverser, Apprentice Harper et al.
AlfCrypto not found. Using python PC1 implementation.
Decrypting Kindle Format 8 ebook
Got DSN key from database C:\Users\Lenovo\Desktop\UnpackKindleS_Release20210604_win_x64_AZW3DeDRM\kindlekey.k4i
Found 4 keys to try after 0.0 seconds
Crypto Type is: 2
File is encoded with PID +WsMx/1x6S.
Decrypting. Please wait . . . done
Decryption succeeded after 0.4 seconds
Saved decrypted book after 0.4 seconds
==============START===============
unknown id 547:496E4D656D6F7279
unknown id 548:496E4D656D6F7279
unknown id 405:00
unknown id 407:0000000000000000
unknown id 403:01
System.Exception: Unhandled Error at INDX
at UnpackKindleS.Azw3File.ProcessIndex()
at UnpackKindleS.Azw3File..ctor(String path)
at UnpackKindleS.Program.ProcPath(String[] args)
at UnpackKindleS.Program.ProcBatch(String[] args)

找不到.azw3文件

mykindlecontent脚本可以成功转化其他书籍,但有一本英文书无法找到azw3文件
image
最新版kindle客户端下载的,目录里长这样
image
#13 #14 中提到的renderer-test并没能在电脑里找到,请问该如何解决?

Merge azw and azw.res files

Would it be possible to make a fast code to directly replace low-ress images in a kindle file with the hi-res versions that doesn't involve unpacking, manually replacing and then passing through kindlegen?

The only code I found anywhere for that is quite clunky...

有二级目录的电子书转换后目录错乱和另一个报错问题

非常感谢大佬的工具,在使用中发现了两个问题反馈一下:
第一个:有二级目录的电子书转换后目录错乱,具体表现为原属于一级目录下的二级目录全部被排列到和一级目录并列的最后面并且点击无效或位置不对,合并前的azw3文件目录是没问题的。
还有一个问题:部分电子书转换过程中红字报错,然后转换出来的epub无法打开。
红字内容如下:
[Error]Cannot Create NCX or NAV.
[Error]System.OverflowException: Arithmetic operation resulted in an overflow.
at UnpackKindleS.Util.SubArray(Byte[] src, Int32 start, Int32 length)
at UnpackKindleS.Epub.KindlePosToUri(Int32 fid, Int32 off)
at UnpackKindleS.Epub.CreateNCX()
at UnpackKindleS.Epub..ctor(Azw3File azw3, Azw6File azw6)
另外两个问题出现时单独的_Tool_Drop_Dump_azwres工具是能正常提取高清图片的。

".epub" only shows the cover

It does create a fine "_nodrm.azw3" file, but the conversion to ".epub" seems to fail.
Kindle version is 1.26.0
UnpackKindleS version: 20210422

There is only the cover image left.
B08J2MTDGP_EBOK.azw - 69,6 MB
B08J2MTDGP_EBOK_nodrm.azw3 - 69,6 MB
[Kodama, Naoko] I married my best friend to shut my parents up.epub - 676 KB

That happed to me for three e-books so far (everything else worked fine):
https://www.amazon.de/dp/B08J2MTDGP
https://www.amazon.de/dp/B08V13ZHX9
https://www.amazon.de/dp/B09232DQKW

遇到了这个问题不知道是哪里出错

D:\BaiduYunDownload\My Kindle Content\B094C69KND_EBOK>cd /d D:\UnpackKindleS_Release20210724_win_x64_AZW3DeDRM\app

D:\UnpackKindleS_Release20210724_win_x64_AZW3DeDRM\app>UnpackKindleS "D:\BaiduYunDownload\My Kindle Content" .. -dedrm -batch --rename-xhtml-with-id
UnpackKindleS Ver.20210724
https://github.com/Aeroblast/UnpackKindleS
Batch Process:D:\BaiduYunDownload\My Kindle Content

D:\UnpackKindleS_Release20210724_win_x64_AZW3DeDRM\app>"D:\UnpackKindleS_Release20210724_win_x64_AZW3DeDRM\AZW3_PC_DeDRM.exe" "D:\BaiduYunDownload\My Kindle Content\B08X15T77B_EBOK\B08X15T77B_EBOK.azw"
Cannot find .azw3 file in D:\BaiduYunDownload\My Kindle Content\B08X15T77B_EBOK

D:\UnpackKindleS_Release20210724_win_x64_AZW3DeDRM\app>"D:\UnpackKindleS_Release20210724_win_x64_AZW3DeDRM\AZW3_PC_DeDRM.exe" "D:\BaiduYunDownload\My Kindle Content\B094C69KND_EBOK\B094C69KND_EBOK.azw"
Cannot find .azw3 file in D:\BaiduYunDownload\My Kindle Content\B094C69KND_EBOK

D:\UnpackKindleS_Release20210724_win_x64_AZW3DeDRM\app>"D:\UnpackKindleS_Release20210724_win_x64_AZW3DeDRM\AZW3_PC_DeDRM.exe" "D:\BaiduYunDownload\My Kindle Content\B09BCL7MLW_EBOK\B09BCL7MLW_EBOK.azw"
Cannot find .azw3 file in D:\BaiduYunDownload\My Kindle Content\B09BCL7MLW_EBOK

D:\UnpackKindleS_Release20210724_win_x64_AZW3DeDRM\app>"D:\UnpackKindleS_Release20210724_win_x64_AZW3DeDRM\AZW3_PC_DeDRM.exe" "D:\BaiduYunDownload\My Kindle Content\B09FJD6DFW_EBOK\B09FJD6DFW_EBOK.azw"
Cannot find .azw3 file in D:\BaiduYunDownload\My Kindle Content\B09FJD6DFW_EBOK

D:\UnpackKindleS_Release20210724_win_x64_AZW3DeDRM\app>pause
QQ图片20210928003439

在bat里也更改了位置了
QQ图片20210928003439
之前都能用但是突然找不到了,请问要怎么做才能重新用呢

处理某些书时产生IndexOutOfRangeException错误

使用UnpackKindleS对已解密的azw3和res进行处理整合,生成epub,我的某些书会产生如下的报错:

UnpackKindleS Ver.20220126
https://github.com/Aeroblast/UnpackKindleS
==============START===============
 unknown id 547:4F6E4469736B
 unknown id 548:4F6E4469736B
 unknown id 405:00
 unknown id 407:0000000000000000
 unknown id 403:00
Unhandled exception. System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at UnpackKindleS.Util.SubArray(Byte[] src, UInt64 start, UInt64 length)
   at UnpackKindleS.Azw3File.ProcessRes()
   at UnpackKindleS.Azw3File..ctor(String path)
   at UnpackKindleS.Program.ProcPath(String[] args)
   at UnpackKindleS.Program.Main(String[] args)

如果需要文件样本,请留一下邮箱,我发给你。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.