chbrown / overdrive

Bash script to download mp3s from the OverDrive audiobook service

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature Request: download epubs

grr opened this issue · comments

commented

There are two types of epubs available for download. The least common type is the "Open EPUB", but it should be easy to implement, since it's a direct download with no DRM.

The second type downloads an ACSM file which you have to open with Adobe Digital Editions to download the encrypted EPUB. Debugging the network traffic, it looks to be relatively straightforward. ADE makes a post request using the info in the ACSM file, and gets another XML file in return, which contains the download link. I might be missing something, as I found a project that makes it sound a bit more complicated: http://indefero.soutade.fr/p/libgourou/ .
Once the encrypted epub is downloaded, the user can use DeDRM to strip the DRM.

You have a point that these EPUBs are coming from an Overdrive library site, and I perhaps should have been more specific when naming this repo, but I feel like anything having to do with DRM is outside the scope of this project. It's feasible to grab audiobooks via a single bash script here because Rakuten apparently doesn't hate people. Compare Audible, who does — there are tools to decode their files, and it is reasonably straightforward once you have the key... but the whole point of DRM is to make finding that key difficult / laborious — far beyond a couple hundred lines of bash.

Also, I'm not quite sure what you're wanting this script to do with the Open EPUB files? Like you said, it's a direct download... so you can just download it and call it a day, no?

The one pain point that might be within the scope of this repo if there were a simple solution, is when an audiobook has a "supplementary file" on Overdrive, which is typically (always?) an ADE-encrypted PDF (which is even more of a pain to de-DRM than an ADE-encrypted EPUB). I don't know of an easier way to handle these other than letting the standard Adobe Digital Editions app handle all the access rights negotiation and downloading, and then decrypting the DRM'd file with another separate open source tool. (Which, from what I've encountered, means a messy script of more than 3k lines of finicky Python2 😒. )