apprenticeharper / DeDRM_tools

DeDRM tools for ebooks
14.39k stars 1.48k forks source link

ADE (2.0.1) PDFs fail to decrypt with latest commit, EPUBs and AZW3s work fine. #1254

Open ajshell1 opened 3 years ago

ajshell1 commented 3 years ago

Just now, I ran "git clone https://github.com/apprenticeharper/DeDRM_tools.git" and then ran "python make_release.py" to make the plugin from the latest git version of this code. To my surprise, it installed without issues on Calibre 5.0

Using the same setup of Adobe Digital Editions 2.0.1 and Kindle for PC 1.17 I had before the upgrade, I tried to decrypt some books.

Several normal EPUBs from ADE decrypted without issues, as did several Kindle books.

However, I recently tried to do the same with a PDF from ADE, and it failed to decrypt.

I am on Arch Linux, using the latest version of Calibre from the Arch repositories, and I used commit de50a02 for my testing. The PDF in question is "Kingdom Come" by Mark Waid and Alex Ross.

Here is the log:

calibre, version 5.0.0

ERROR: Loading book failed: Failed to open the book at /home/aj/Books/Calibre/Unknown/Kingdom Come (15630)/Kingdom Come - Unknown.pdf. Click "Show details" for more info.

Failed to convert book: /home/aj/Books/Calibre/Unknown/Kingdom Come (15630)/Kingdom Come - Unknown.pdf with error: DeDRM v7.0.0: Trying to decrypt Kingdom Come - Unknown.pdf DeDRM v7.0.0: Kingdom Come - Unknown.pdf is a PDF ebook Syntax Error: Couldn't find the 'EBX_HANDLER' security handler pdfinfo errored out with return code: 1 InputFormatPlugin: PDF Input running on /home/aj/Books/Calibre/Unknown/Kingdom Come (15630)/Kingdom Come - Unknown.pdf Failed to run pipe worker with command: from calibre.srv.render_book import viewer_main; viewer_main() Traceback (most recent call last): File "/usr/lib/calibre/calibre/customize/ui.py", line 428, in get_file_type_metadata mi = plugin.get_metadata(stream, ftype.lower().strip()) File "/usr/lib/calibre/calibre/customize/builtins.py", line 342, in get_metadata return get_quick_metadata(stream) File "/usr/lib/calibre/calibre/ebooks/metadata/pdf.py", line 127, in get_metadata raise ValueError('Could not read info dict from PDF') ValueError: Could not read info dict from PDF Running file type plugin DeDRM failed with traceback: Traceback (most recent call last): File "/usr/lib/calibre/calibre/customize/ui.py", line 172, in _run_filetype_plugins nfp = plugin.run(nfp) or nfp File "calibre_plugins.dedrm.init", line 633, in run File "calibre_plugins.dedrm.init", line 423, in PDFDecrypt AttributeError: 'str' object has no attribute 'decode' Traceback (most recent call last): File "/usr/bin/calibre-parallel", line 20, in sys.exit(main()) File "/usr/lib/calibre/calibre/utils/ipc/worker.py", line 195, in main exec(sys.argv[-1]) File "", line 1, in File "/usr/lib/calibre/calibre/srv/render_book.py", line 871, in viewer_main render_for_viewer(*args) File "/usr/lib/calibre/calibre/srv/render_book.py", line 862, in render_for_viewer return render( File "/usr/lib/calibre/calibre/srv/render_book.py", line 839, in render book_fmt, opfpath, input_fmt = extract_book(pathtoebook, output_dir, log=default_log) File "/usr/lib/calibre/calibre/ebooks/oeb/iterator/book.py", line 63, in extract_book pathtoopf = plumber.input_plugin(inf, File "/usr/lib/calibre/calibre/customize/conversion.py", line 245, in call ret = self.convert(stream, options, file_ext, File "/usr/lib/calibre/calibre/ebooks/conversion/plugins/pdf_input.py", line 54, in convert pdftohtml(getcwd(), stream.name, options.no_images) File "/usr/lib/calibre/calibre/ebooks/pdf/pdftohtml.py", line 83, in pdftohtml raise ConversionError('pdftohtml failed with return code: %d\n%s' % (ret, out)) calibre.ebooks.ConversionError: pdftohtml failed with return code: 1 Syntax Error: Couldn't find the 'EBX_HANDLER' security handler

Let me know if there is any more info I can provide.

I'd also like to thank you for all the work you've done in creating this plugin. Your work has improved my life substanially.

ElleKayEm commented 3 years ago

This PDF is tied to the same Adobe ID as the EPUBs which you successfully decrypted?

joseantoniosa commented 3 years ago

Same issue with calibre 5.0.1, DeDRM_tools from git and python3.8. (Is it a python related problem?). I am using Debian testing. Thank you. Edit: Sorry I am using ADE-4.5. I will go back to ADE 2.x

ElleKayEm commented 3 years ago

Work is still ongoing to make DeDRM compatible with Python 3.

apprenticeharper commented 3 years ago

Indeed it is, but it's a long job with lots of code to convert and check, on Mac, PC and Linux.