Skip to content

Instantly share code, notes, and snippets.

@ping
Last active November 21, 2024 04:00
Show Gist options
  • Save ping/b58ae66359691db1d08f929a9e57a03d to your computer and use it in GitHub Desktop.
Save ping/b58ae66359691db1d08f929a9e57a03d to your computer and use it in GitHub Desktop.
Bookmarklet to add download links for audiobooks in the Overdrive loans page
/* 1. Paste this entire gist over at https://mrcoles.com/bookmarklet/ to generate a bookmarklet */
/* 2. Use a meaningful Name like: 🎧 📖 Links */
/* 3. Drag the generated bookmarklet link to your Bookmarks Toolbar. */
/* 4. Click on the bookmarklet when you're on the Overdrive loan page, e.g. https://yourlibrary.overdrive.com/account/loans */
/* 5. The "Download MP3 audiobook" link should appear like it used to. */
$('a[data-format-id="audiobook-overdrive"]').each(function() {
var listenBtn = $(this);
if (listenBtn.hasClass('script-added')) {
listenBtn.remove();
return;
}
var dlBtn = listenBtn.clone();
dlBtn.attr('class', 'loan-button-nonkindle button radius primary downloadButton script-added');
dlBtn.attr('href', dlBtn.attr('href').replace('/audiobook-overdrive/', '/audiobook-mp3/'));
dlBtn.html('<b>Download</b><br/><span class="dl-text">MP3 audiobook</span>');
dlBtn.attr('target', '');
listenBtn.parent().append(dlBtn);
});
@joshcsmith13
Copy link

image

@joshcsmith13
Copy link

If anybody else is wondering about this, it has to do with OverDrive deprecating the OverDrive app. You now have to use "Libby" - which doesn't even have a Windows application. Anyway, you can still use this scriptlet/bookmarklet to download the ODM file, and then you can use the odmpy commandline tool to open and download it.
The original code base is here: https://github.com/ping/odmpy
but you'll need the forked version here to get past the one-time Setup process: https://github.com/jordkh/odmpy

@joshcsmith13
Copy link

^ for some reason, the odm download within those projects is not working correctly, but the "DL" option still works with the odm file downloaded with this bookmarklet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment