I buy a lot of media, and I don't trust it to always be available. Here's some tools to back all of that up.
Overdrive (now Libby) got rid of the desktop client. But chbrown created a script that downloads MP3s if you can get the odm file.
- Go to a library page, like https://nypl.overdrive.com/
- Borrow a book.
- Click "Do you have the OverDrive app?" and it'll give you a link to an ODM file.
- Toss that into the volume mounted
./overdrive/audiobooks
and you can run the following command:
docker-compose exec overdrive overdrive download YOUR_BOOK.odm
Knock can handle everything for us to convert .ascm
to .epub
.
docker-compose exec overdrive knock YOUR_BOOK.ascm
So, downloading audible is easy enough. Just on PC go in and grab the download files. The problem is that Audible downloads a DRMed AAX
file. To decrypt back to MP3
, we need to find our AUTHCODE
. I've found two approaches for getting it, but it should only need to be ran once per user regardless. Then it'll just be decrypting.
We need to get your AUTHCODE off of one of your audible books. This is unique per account. After placing one of your .AAX
files into ./audible/audiobooks
, run the following:
docker-compose exec audible find_auth_code SOME_FILE.aax
Now update the .env
in the same folder as docker-compose.yaml
to look like the following, replacing YOUR_HEX with what you just found.
AUTHCODE=YOUR_HEX
Then restart the compose with docker-compose up -d
.
docker-compose exec audible convert_aax SOME_FILE.aax
- Download and install an older version of Kindle for Windows (
KindleForPC-installer-1.17.44170.exe
).- This is so you get the older AZW format.
- Download the book you want.
- Extract it from local copy:
C:\Users\UserName\Documents\My Kindle Content
- Find decryption key for local Windows machine.
- Update configs.
- Dedrm by adding to calibre:
calibredb add --with-library ./library <FILE.AZW>
- Might be able to just convert the AZW directly with
ebook-convert <FILE.AZW> <FILE.EPUB>
or whatever extension you want.- For PDF, need to run as non-root.
docker-compose exec kindle bash
cd /Ebooks
calibredb add --with-library ./library <FILE.AZW>
docker-compose exec kindle bash
cd /Ebooks
su - fart -c "bash"
ebook-convert <FILE.AZW> /tmp/<FILE.EPUB>
ebook-convert <FILE.AZW> /tmp/<FILE.PDF>
exit
mv /tmp/*.pdf .
mv /tmp/*.epub .
Gotta install from an older version.
- https://packages.ubuntu.com/bionic/amd64/libmp4v2-2/download
- https://packages.ubuntu.com/bionic/amd64/mp4v2-utils/download
Like with the Learn German with Stories series, all of the books keep overwriting each other because they have the same Title. But I should be able to add a Subtitle to the folder name. The overdrive
binary doesn't seem to let me change the output structure (look into updating that...). But I can take a look at <ODM>.metadata
and grab the values I want with xml.etree.ElementTree
.
<Metadata>
<ContentType>MP3 Audio Book</ContentType>
<Title>Learn German with Stories</Title>
<SubTitle>Digital in Dresden: 10 Short Stories for Beginners</SubTitle>
<SortTitle>Learn German with Stories Digital in Dresden 10 Short Stories for Beginners</SortTitle>
<Series>Dino lernt Deutsch</Series>
<Publisher>learnoutlive</Publisher>
<ThumbnailUrl>https://images.contentreserve.com/ImageType-200/7552-1/{2483D474-479C-4981-9381-380649157F08}Img200.jpg</ThumbnailUrl>
<CoverUrl>https://images.contentreserve.com/ImageType-100/7552-1/{2483D474-479C-4981-9381-380649157F08}Img100.jpg</CoverUrl>
<Creators>
<Creator role="Author" file-as="Klein, André">André Klein</Creator>
<Creator role="Narrator" file-as="Klein, André">André Klein</Creator>
</Creators>
<Subjects>
<Subject id="28">Foreign Language Study</Subject>
<Subject id="111">Nonfiction</Subject>
</Subjects>
<Languages>
<Language code="de">German</Language>
</Languages>
<Description><p>Experience the <strong>ninth episode</strong> of the <strong>Dino lernt Deutsch</strong> <strong>story series for German learners</strong> on your stereo or headphones, at home or on the go!</p><br /><p>Dino lands a promising new office job in Dresden with stable pay and promotion opportunities, but it's only so long before corporate implications force him to make a tough decision.</p><br /><p>The narration speed and style of this audiobook is aimed at beginners and intermediates, with special emphasis on clear pronunciation, so that you can easily pause and repeat words and phrases whenever you please.</p><br /><p>(To get the most out of this audiobook we recommend listening while reading through a paperback or ebook edition of "Learn German with Stories: Digital in Dresden – 10 Short Stories for Beginners" and working through the exercises.)</p><br /><p>Playing time: 1:32:21</p><br /><p>Written and narrated by André Klein</p><br /><p>Copyright 2019, learnoutlive.com</p></Description>
</Metadata>
Diving deeper in the overdrive
binary, I see a section that should allow me to modify the folder structure. And if I use the --output
param after making changes in this section I can leverage more replacement words. I'll just need to create extractors for any new term.
- https://github.com/chbrown/overdrive
- https://github.com/KrumpetPirate/AAXtoMP3
- https://blog.dtpnk.tech/en/howto/convert_audible_to_mp3/#
- inAudible-NG's audible-activator looks to pull your audible
AUTHCODE
from the browser. - inAudible-NG's tables looks to use a rainbow table to hack your
AUTHCODE
due to collision. - https://github.com/mkb79/audible-cli
- https://github.com/openaudible/openaudible, junk ignore this.
- https://www.cloudwards.net/remove-drm-from-kindle-books/
- https://github.com/BentonEdmondson/knock