Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 09-25-2021, 11:44 AM   #1
Leseratte_10
Enthusiast
Leseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned off
 
Posts: 44
Karma: 97166
Join Date: Sep 2021
Device: PRS-T2
[FileType Plugin] ACSM input plugin

ACSM import support for Calibre

This plugin is a replacement for Adobe Digital Editions (ADE) which allows you to turn an ACSM file into an EPUB or PDF just like ADE would.

A couple months ago, Grégory Soutadé created an open-source ADE replacement library (libgourou) in C++ which can be used to "convert" ACSM files into EPUB or PDF files - see the thread https://www.mobileread.com/forums/sh...d.php?t=340479

A couple days ago, I noticed that library and started to look at how that worked. First I only managed to make a small Calibre plugin that just executes his library / binary, so the first version was Linux-only, but then I was able to completely reimplement the libgourou library in native Python as a Calibre plugin.

This means, that Windows, Linux, and Mac users can just add this FileType plugin to Calibre, enter their AdobeID credentials in the plugin settings, and then just drag-and-drop an ACSM file into Calibre and it'll turn into an EPUB or PDF.

The source code, if you want to take a look, can be found here: https://github.com/Leseratte10/acsm-calibre-plugin

Couple important notes:
  • I would suggest creating a new dummy AdobeID to use for Calibre so just in case Adobe detects this and bans you, you don't lose your main AdobeID.
  • Combined with that I suggest importing the DER file into the Alf plugin to make sure that losing your AdobeID doesn't also mean you'll lose access to all your eBooks.
  • Support for PDFs might be unreliable. In order to use DeDRM with PDFs you'll need to apply PR #1689 (including the bugfix in the comments). If there's still issues please send me the PDF file and I'll take a look.
  • This software is not approved by Adobe. I am not responsible if Adobe detects that you're using nonstandard software and bans your account. Do not complain to me if Adobe bans your main ADE account - you have been warned. So far, none of my test accounts have been banned, but you never know ...

How to setup:
  • Download the plugin from this post and import it into Calibre
  • Go into the plugin settings, click "Link to ADE account" and enter your AdobeID credentials
  • After a couple seconds the window should now say "Authorized with AdobeID X" instead of "Not authorized"
  • Click the "Export account activation data" and "Export account encryption key" buttons to export / backup your keys. The first backup can be used to restore the Adobe authorization after a reinstall / reset without wasting one of the 6 activations, the second key file (DER) can be used for DeDRM.
  • Download an ACSM file from Adobe's test library ( https://www.adobe.com/de/solutions/e...k-library.html ) and see if you can import it into Calibre and if it turns into an EPUB or PDF.

Version History:

Spoiler:

Version 0.0.12 - 15 Nov 2021
- Fixes a bug that caused the plugin to not show up in the Calibre Plugin index. You can now download and update this Plugin directly from Calibre.

Version 0.0.11 - 12 Nov 2021
- Ignore SSL errors during FulfillmentNotification. This fixes distributors that have a broken SSL setup on their servers.
- Update & improve the Adobe signature hashing algorithm. Fixes some edge cases that probably don't affect any actual book anyways ...
- Small (potential) bugfix for distributors using the PassHash system (e. g. Barnes & Noble)
- Activation key exports now include the user ID in the (default) filename.
- Fixes a bug where other EPUB- and PDF-capable FileTypePlugins wouldn't run on files created by this plugin.

Version 0.0.10 - 23 Oct 2021
- Due to a stupid bug with the Adobe nonce calculation the plugin stopped working a couple days ago. You will probably receive the error message "int too big to convert" with v0.0.9 and earlier. If so, please update to v0.0.10.
- Try to use Cryptodomex if Crypto is not available. This fixes the error "local variable 'update_account_path' referenced before assignment" on some Linux distributions.

Version 0.0.9 - 4 Oct 2021
- Add support for the Adobe record "FulfillmentNotification". This lets the Adobe server (and the book distributor server) know you've successfully downloaded a book. This is not strictly required to fulfill a book, but it brings the behaviour of this plugin closer to the exact behaviour of ADE and thus reduces the chance of Adobe detecting and blocking this plugin. If you don't like this feature it can be disabled in the plugin settings.
- Add support for the Adobe record "LoanReturn". This lets you return a loaned eBook to the library (only if FulfillmentNotification support is enabled). This only works with books downloaded with v0.0.9 or newer.

Version 0.0.8 - 3 Oct 2021
- Fix some more issues with some PDF files
- Fix for PDF files larger than 4GB
- Fix for PDF or EPUB files larger than available RAM
- Fix for ACSM files not showing up in Calibre's "Add book" dialog

Version 0.0.7 - 1 Oct 2021
- Bugfix for some PDF files
- More debug logs for PDF issues
- Fix locale bug on MacOS

Version 0.0.6 - 28 Sep 2021
- First support for PDF files
- Add functionality to import an existing activation backup from a previous installation

Version 0.0.5 - 27 Sep 2021
- Bugfix: With version 0.0.4, the DeDRM plugin was also executed on imported books if it was installed but has been disabled in the Calibre settings. With this update the DeDRM plugin is only executed if it's enabled.
- Addition: There's now a standalone Python script included in the ZIP file (get_key_from_Adobe.py) that can be used to download the account DER encryption key (for DeDRM) from Adobe's servers without using up one of the six activations.

Version 0.0.4 - 26 Sep 2021
- Make plugin compatible with DeDRM, it's no longer needed to modify the DeDRM plugin to make it work.

Version 0.0.3 - 25 Sep 2021
- First version published on mobileread.
- Code completely rewritten in Python-only, no longer dependant on the Linux-only libgourou library

Version 0.0.2 - 21 Sep 2021 - unreleased development version
- Fix a bug with encryption key export

Version 0.0.1 - 20 Sep 2021
- First version - Linux-only as it still uses the C++ libgourou instead of my own Python implementation.

Attached Files
File Type: zip DeACSM_0.0.12.zip (860.7 KB, 679 views)

Last edited by Leseratte_10; 11-15-2021 at 02:36 AM. Reason: Update to v0.0.12
Leseratte_10 is offline   Reply With Quote
Old 09-25-2021, 08:22 PM   #2
Leseratte_10
Enthusiast
Leseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned off
 
Posts: 44
Karma: 97166
Join Date: Sep 2021
Device: PRS-T2
Beta test

In this post I have attached version 0.0.13-beta3 of the plugin. It has lots of changes to the ADE handling / emulation so I'm putting it into this post for beta-testing instead of immediately pushing it to everyone through the Calibre updater.

- While authorizing, you can pick between the following ADE versions: 2.0.1, 3.0.1, 4.0.3, 4.5.11 (2.0.1 recommended)
- After authorizing, you can freely switch between the following ADE versions: 1.7.2, 2.0.1, 3.0.1, 4.0.3, 4.5.11. The ADE 1.7.2 support is very experimental so only use this if necessary. It's recommended to just use 2.0.1.
- There's a new button "Import activation from ADE" in the plugin settings if the plugin is not authorized yet. Clicking this button will attempt to import an existing activation from ADE into the plugin. On MacOS, a couple password dialogs will pop up during import - just enter your Mac user account password (not your ADE password) to allow Calibre to access the ADE activation.
- Fix race condition when importing multiple ACSM files at the same time
- Fix a bug where authorization would fail with certain non-ASCII characters in the OS username.

Changes from beta2 to beta3:

- In the plugin settings you can press Ctrl+Shift+D to remove an existing authorization.
- Support for importing authorization from ADE running in WINE on Linux.
- Fix device_type bug in beta1 and beta2 reported by jhowell
Attached Files
File Type: zip 0.0.13-beta3.zip (894.8 KB, 12 views)

Last edited by Leseratte_10; 11-25-2021 at 04:20 AM.
Leseratte_10 is offline   Reply With Quote
Old 09-26-2021, 08:17 AM   #3
Leseratte_10
Enthusiast
Leseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned off
 
Posts: 44
Karma: 97166
Join Date: Sep 2021
Device: PRS-T2
Just updated the plugin to v0.0.4. Unfortunately I don't have enough posts here yet to be able to edit my first post and attach the new version, so it's probably best to just post a link to the Github Releases page where there will always be the most recent version: https://github.com/Leseratte10/acsm-...lugin/releases

With this update the plugin is compatible with DeDRM, meaning, there's no longer any code changes needed in the DeDRM plugin, it will just work automatically (as long as your key is imported in the DeDRM plugin settings). Once I have enough posts to edit my first post I'll remove the paragraph about the DeDRM modifications.



Initial post updated to have new version
PeterT


^ Thanks PeterT for updating, now I finally have enough posts to edit previous ones so I'll be able to add future updates myself.

Last edited by Leseratte_10; 09-27-2021 at 01:19 AM.
Leseratte_10 is offline   Reply With Quote
Old 09-26-2021, 09:06 PM   #4
Joliet Jake
Enthusiast
Joliet Jake has a complete set of Star Wars action figures.Joliet Jake has a complete set of Star Wars action figures.Joliet Jake has a complete set of Star Wars action figures.Joliet Jake has a complete set of Star Wars action figures.
 
Posts: 48
Karma: 342
Join Date: Feb 2021
Location: Canada
Device: Kobo Forma
Is this backward compatible with older versions of Calibre (specifically 4.23)?
Joliet Jake is offline   Reply With Quote
Old 09-27-2021, 01:12 AM   #5
Leseratte_10
Enthusiast
Leseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned off
 
Posts: 44
Karma: 97166
Join Date: Sep 2021
Device: PRS-T2
I haven't tested it, but I would be surprised if it is. I bet I've used one or the other Python 3 feature in the plugin. Though I can try it and see what happens.

EDIT: Just tested it, no, it's not compatible. I tried making it compatible with Python 2 but there's some weird errors with the libadobe imports that I can't get fixed, so for now this plugin will require Calibre 5.0 or newer.

Last edited by Leseratte_10; 09-27-2021 at 02:42 AM.
Leseratte_10 is offline   Reply With Quote
Old 09-27-2021, 03:48 PM   #6
Leseratte_10
Enthusiast
Leseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned off
 
Posts: 44
Karma: 97166
Join Date: Sep 2021
Device: PRS-T2
Finally managed to fulfill a couple PDF files. Just need to clean up the code a bit, and I imagine tomorrow or Wednesday there will be an update to add PDF support.
Leseratte_10 is offline   Reply With Quote
Old 09-28-2021, 01:49 PM   #7
Leseratte_10
Enthusiast
Leseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned off
 
Posts: 44
Karma: 97166
Join Date: Sep 2021
Device: PRS-T2
v0.0.6 is now available which supports PDF files, too.

PDF support might still be slightly unreliable due to how complex the PDF format is, if you find any file where the resulting PDF seems to be corrupt please let me know.
Leseratte_10 is offline   Reply With Quote
Old 09-29-2021, 07:06 PM   #8
un_pogaz
Chalut o/
un_pogaz is the One.un_pogaz is the One.un_pogaz is the One.un_pogaz is the One.un_pogaz is the One.un_pogaz is the One.un_pogaz is the One.un_pogaz is the One.un_pogaz is the One.un_pogaz is the One.un_pogaz is the One.
 
un_pogaz's Avatar
 
Posts: 215
Karma: 101867
Join Date: Dec 2017
Device: Kobo
To make sure I understood correctly:
This plugin allows to import the ePub/PDF file associated to an ACSM file exactly as Adobe Digital Editions does?

(With their DRM that will to be handled... elsewhere )
un_pogaz is offline   Reply With Quote
Old 09-30-2021, 01:32 AM   #9
Leseratte_10
Enthusiast
Leseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned off
 
Posts: 44
Karma: 97166
Join Date: Sep 2021
Device: PRS-T2
That's the point of this plugin, yeah. Create an EPUB or PDF just like ADE would, with DRM.

I have tested a couple EPUB and PDF files and the resulting file was always 100% identical to the one generated by ADE. I have no idea whether that's always the case, but it should always generate a file that's semantically identical.

Last edited by Leseratte_10; 09-30-2021 at 01:45 AM.
Leseratte_10 is offline   Reply With Quote
Old 09-30-2021, 02:35 AM   #10
droopy
Guru
droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.droopy ought to be getting tired of karma fortunes by now.
 
Posts: 752
Karma: 2912460
Join Date: Apr 2009
Device: Kobo Forma
Thank you, Leseratte_10 (OP).
Your work means I don't have to bother with Wine-ADE on my Linux system. It also means I don't have to do "terminal" work with the soutade binary/files.
droopy is offline   Reply With Quote
Old 09-30-2021, 04:16 AM   #11
un_pogaz
Chalut o/
un_pogaz is the One.un_pogaz is the One.un_pogaz is the One.un_pogaz is the One.un_pogaz is the One.un_pogaz is the One.un_pogaz is the One.un_pogaz is the One.un_pogaz is the One.un_pogaz is the One.un_pogaz is the One.
 
un_pogaz's Avatar
 
Posts: 215
Karma: 101867
Join Date: Dec 2017
Device: Kobo
Quote:
Originally Posted by Leseratte_10 View Post
That's the point of this plugin, yeah. Create an EPUB or PDF just like ADE would, with DRM.
Yes. Perfect. I will finally be able to get rid of ADE. Thanks you.

It's nice to say how it works and how its idea came to you, but the purpose of the plugin is not clear and I had to deduct it.
Is missing a little paragraph in the first line ""ADE in Calibre"".
un_pogaz is offline   Reply With Quote
Old 09-30-2021, 09:25 PM   #12
rcentros
eReader Wrangler
rcentros ought to be getting tired of karma fortunes by now.rcentros ought to be getting tired of karma fortunes by now.rcentros ought to be getting tired of karma fortunes by now.rcentros ought to be getting tired of karma fortunes by now.rcentros ought to be getting tired of karma fortunes by now.rcentros ought to be getting tired of karma fortunes by now.rcentros ought to be getting tired of karma fortunes by now.rcentros ought to be getting tired of karma fortunes by now.rcentros ought to be getting tired of karma fortunes by now.rcentros ought to be getting tired of karma fortunes by now.rcentros ought to be getting tired of karma fortunes by now.
 
rcentros's Avatar
 
Posts: 6,101
Karma: 40421288
Join Date: Mar 2013
Location: Boise, ID
Device: PB HD3, GlowLight 3, Tolino Vision 4, Voyage
Thank you, Leseratte_10. Never could get ADE to work in Wine (not a big fan of Wine anyhow). This works perfectly. Thanks!

As for Calibre... I was using 4.18. De-ASCM wouldn't work there, so I had a good reason to upgrade.
rcentros is offline   Reply With Quote
Old 10-01-2021, 01:55 AM   #13
Leseratte_10
Enthusiast
Leseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned offLeseratte_10 can read ebooks with the screen turned off
 
Posts: 44
Karma: 97166
Join Date: Sep 2021
Device: PRS-T2
Quote:
Originally Posted by rcentros View Post
As for Calibre... I was using 4.18. De-ASCM wouldn't work there, so I had a good reason to upgrade.
Yeah, Calibre 4.X is still using Python 2, Calibre 5 and above uses Python 3. I started developing this plugin in Python 3 (because nobody should still develop new stuff in Python 2 in 2021), and although I tried to make it Python-2-compatible afterwards I ran into a bunch of issues with that, so you'll have to use Calibre 5.
Leseratte_10 is offline   Reply With Quote
Old 10-01-2021, 02:35 AM   #14
rcentros
eReader Wrangler
rcentros ought to be getting tired of karma fortunes by now.rcentros ought to be getting tired of karma fortunes by now.rcentros ought to be getting tired of karma fortunes by now.rcentros ought to be getting tired of karma fortunes by now.rcentros ought to be getting tired of karma fortunes by now.rcentros ought to be getting tired of karma fortunes by now.rcentros ought to be getting tired of karma fortunes by now.rcentros ought to be getting tired of karma fortunes by now.rcentros ought to be getting tired of karma fortunes by now.rcentros ought to be getting tired of karma fortunes by now.rcentros ought to be getting tired of karma fortunes by now.
 
rcentros's Avatar
 
Posts: 6,101
Karma: 40421288
Join Date: Mar 2013
Location: Boise, ID
Device: PB HD3, GlowLight 3, Tolino Vision 4, Voyage
Quote:
Originally Posted by Leseratte_10 View Post
Yeah, Calibre 4.X is still using Python 2, Calibre 5 and above uses Python 3. I started developing this plugin in Python 3 (because nobody should still develop new stuff in Python 2 in 2021), and although I tried to make it Python-2-compatible afterwards I ran into a bunch of issues with that, so you'll have to use Calibre 5.
The Calibre 5 GUI looks almost identical to the Calibre 4 one. So I'm not missing anything. Thanks again.
rcentros is offline   Reply With Quote
Old 10-01-2021, 03:54 AM   #15
odamizu
just an egg
odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.
 
odamizu's Avatar
 
Posts: 1,375
Karma: 2688282
Join Date: Mar 2015
Device: Kindle Oasis1 & Voyage, iOS
Intriguing plugin. Thank you, Leseratte_10

I am trying this on macOS Catalina. When I input Adobe credentials, I get:

ERROR: Unhandled exception: <b>TypeError</b>:Argument must be bytes or unicode, got 'NoneType'

Suggestions?

Last edited by odamizu; 10-01-2021 at 04:49 PM.
odamizu is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[FileType Plugin] GetFileName Terisa de morgan Plugins 375 10-16-2021 05:37 AM
help with epub on_import filetype plugin digitalvideo Development 4 02-27-2020 06:13 AM
[FileType Plugin] YVES Bible Plugin ClashTheBunny Plugins 25 10-13-2019 12:32 AM
Question about file_types in FileType plugin Terisa de morgan Plugins 6 02-08-2017 06:53 AM
Zip Filetype Plugin? rsingley Plugins 7 02-11-2011 06:11 PM


All times are GMT -4. The time now is 04:38 AM.


MobileRead.com is a privately owned, operated and funded community.