ping/odmpy

Feature: Generate file containing metadata information

wtanksleyjr opened this issue · 8 comments

It's not easy to get good metadata about audiobooks (Overdrive tags are terrible); would it be possible to save the metadata Overdrive/Libby provides in a durable form alongside the MP3s? I used to parse the ODM files, but many projects think they're being retired, and anyhow the libby interface of odmpy doesn't save them anymore.

My favorite format is OPF, but a json dump would be adequate.

ping commented

By default, the new odmpy libby command still uses an odm-based mechanism unless you use the --direct option. To keep the odm file, include the --keepodm option which was intended to allow users to return the loan via odmpy.

--keepodm will retain both the odm and license files in the -d/--downloaddir folder specified.

odmpy libby --keepodm

I will look into generating an accompanying OPF file with the download.

ping commented

The latest version 0.6.3 now suports an --opf option that will generate an OPF in the book folder.

# download with odm
odmpy dl test.odm --opf

# download with libby
odmpy libby --opf

I don't personally use OPF at all, so please give it a try and let me know if it works for you.

OK, the info in the OPF is great, but there's a problem with the title; for some reason Audiobookshelf (ABS) doesn't see it. I'm going to experiment a bit with my own ODM->OPF converter (which DOES work with ABS) to see if I can find the reason and get back to you.

OK, I have a really simple answer: your OPF file is fine, but it looks like the software I'm using (ABS) chokes on the opf:file-as tag. I'd say you've got this one working, I'll report that as a possible bug to them.

ping commented

OK, I have a really simple answer: your OPF file is fine, but it looks like the software I'm using (ABS) chokes on the opf:file-as tag. I'd say you've got this one working, I'll report that as a possible bug to them.

@wtanksleyjr I reviewed the EPUB specificiations and the opf:file-as attribute may not be a standard attribute for the <dc:title> element. I added it thinking that it should not create any problems. Until you get a response on your report, I will remove it for the next release.

ping commented

@wtanksleyjr

Based on my additional research, it does look like opf:file-as is an invalid attribute for <dc:title>. The new 0.6.4 release has this fixed.

0.6.4 also improves the ID3 tags output. Because odmpy tries to non-destructively update the ID3 tags by default, you may need to include the new option --overwritetags to see a difference. This applies to both the existing dl ODM mode as well as for the new libby interface.

odmpy dl --overwritetags TestBook.odm

odmpy libby --overwritetags

Since you seem to rely heavily on metadata, I will appreciate if you can give this a test and see if the tags are good enough for you to not require the OPF.