Leseratte10 / acsm-calibre-plugin

Calibre plugin for ACSM->EPUB and ACSM->PDF conversion.
https://www.mobileread.com/forums/showthread.php?t=341975
GNU General Public License v3.0
600 stars 23 forks source link

Unable to decrypt pdf #7

Closed thekalinga closed 2 years ago

thekalinga commented 2 years ago

I tried download a pdf from acsm file. Unfortunately, the pdf is not downloaded by Calibre.

I have attached a sample acsm thats new & unfufilled (I have not downloaded pdf using the acsm). I tried with a different file (but from same website) & its not working

Environment

Ubuntu 16.04

Calibre 5.31.1

police-abuse-and-killings-of-street-children-in-india.acsm.zip

Leseratte10 commented 2 years ago

I just downloaded that ACSM file, imported it into Calibre and it does turn into a valid, readable PDF file, so I cannot confirm this issue.

Can you run Calibre in debug mode (Preferences -> Restart in debug mode), then import the ACSM, then close Calibre, and then send me the resulting log file / attach it to this issue report so I can take a look at what exactly is failing for you?

thekalinga commented 2 years ago

Are you able to view the pdf?

Leseratte10 commented 2 years ago

Yes, I am. Does the tool fail to download the PDF, or does it download the PDF but it is unreadable due to DRM? This plugin does not remove DRM on its own, you'll need the DeDRM plugin to do that. And that plugin needs custom patches to work properly with PDFs.

thekalinga commented 2 years ago

Oh OK..

Its downloading the pdf. Its locked due to DRM. I have the DeDRM plugin, but I dont have custom patches for PDFs :(

Is there a place where I can get patched DeDRM plugin?

thekalinga commented 2 years ago

custom patch* for pdf

Leseratte10 commented 2 years ago

I'm not sure if there's an already packaged version of the patched DeDRM plugin, but the necessary changes are described here: https://github.com/apprenticeharper/DeDRM_tools/pull/1689 As this is not a bug with my plugin, I'm going to close this issue then.

thekalinga commented 2 years ago

Thanks for that.

I made the following changes

  1. Uninstalled both DeDRM & ACSM plugins from Calibre
  2. Extracted DeDRM plugin source
  3. Made changes in pull request #1689 to ineptpdf.py
  4. Also made additional change you suggested to ineptpdf.py (attached modified ineptpdf.py)
  5. Zipped DeDRM plugin
  6. Installed modified DeDRM plugin & ACSM plugin
  7. Ensured ACSM plugin was authorised with Adobe
  8. Opened ACSM. I still have the same issue :(

Pdf is downloaded, but its not decrypted. Evience is saying the document is locked :(

ineptpdf.py.zip

image

Leseratte10 commented 2 years ago

Can you run Calibre in debug mode (Preferences -> restart in debug mode), then import the ACSM, then close Calibre and send me the log file?

Also, did you even import your key into the DeDRM plugin? Try going into the ACSM plugin settings, click "Export account encryption key" and save that to a file, then go into the DeDRM settings, click on "Adobe Digital Editions books", then click "Import existing keyfiles" and choose the same file.

thekalinga commented 2 years ago

I dint manually export the key from ACSM & import it in DeDRM. Now I did it. That solved the issue. Thanks a lot.