![]() |
Guide: Removing iTunes metadata from ePub
I recently came across a problem when adding my ebook collection to my iPhone via iTunes and thought the knowledge I gained finding a solution might be useful for others.
I used a program called calibre to edit an ePub's metadata (title and author) and then added it to iTunes to copy onto my iPhone. But when I did, iTunes was still using the old metadata with the old title and author, not the new ones. After a lot of digging (and this useful post) I managed to figure out why. ePubs are an archive with a bunch of smaller files inside of it, including one file called content.opf that contains the metadata. When an ePub is added to iTunes, it doesn't read its metadata from content.opf; it reads it from another file, iTunesMetadata.plist. If the iTunesMetadata.plist file doesn't exist, iTunes will create one based off content.opf and put it inside the original ePub. That means when you first add an ePub to iTunes, its metadata will match properly because iTunesMetadata.plist is being created for the first time using the up-to-date metadata... but if you ever change the ePub's metadata, you'll only be changing content.opf and iTunes will continue to use the old, unchanged metadata from iTunesMetadata.plist. The solution is to use rar or zip or some other archive program to delete the iTunesMetadata.plist file inside the .epub file before adding the ePub to iTunes. If you do that, iTunes will be forced to create a new iTunesMetadata.plist file with the latest metadata. But if you're like me and have a huge library, doing this manually for every file would take a long time. So I wrote a Windows batch script (included below) to quicken the process. I've gotten into the habit of running this script every time before I add new ebooks to iTunes and it has saved me a lot of headaches. To run it, you'll need to download zip.exe (I got it from here, but there's plenty of other places to get it) and save it somewhere on your computer. Then create a .bat batch file with this text inside: Code:
FOR /R "C:\Users\Jordan\Calibre Library" %%G IN (*.epub) DO "C:\CommandLineTools\zip.exe" -d "%%G" iTunesMetadata.plist"C:\Users\Jordan\Calibre Library" is the location of my ePub collection, and "C:\CommandLineTools\zip.exe" is the location of my zip.exe (as explained above). Change these path locations to match wherever your ePub collection and zip.exe are located. Hope this helps someone :) |
The Modify ePub plugin for calibre will also remove the iTunesMetadata.plist file from one or more books when the "Remove iTunes files" option is selected.
|
> The Modify ePub plugin for calibre will also remove the iTunesMetadata.plist file from one or more books when the "Remove iTunes files" option is selected.
... Ohh my God ... I spent a few hours trying to figure out why it was happening, and then about an hour figuring out how to automate it. And there's a plugin that does it in under a second. Euuurrrrrggghh. Thank you for telling me about this though :) Do you know if there's a way to automatically run the Modify ePub plugin every time you save to disk? |
Quote:
I don't use iTunes or iBooks for reading ebooks, but I'm always curious about these things. On iTunes 12.8.2.3, it won't accept ebooks/epubs (at least not in a way I could figure out). When I copied an epub over to iBooks 1.15, the original epub file did not appear to be altered. Where is this iTunesMetadata.plist file? Is it an invisible/hidden file? When I unzipped the original epub after copying it over to iBooks, it was unchanged as far as I can tell. Thanks for any enlightenment :) |
Quote:
Modify EPUB can be run from the command line - instructions are in first post, and you can save to disk with the calibredb export command. Or almost everything in calibre can be given a keyboard shortcut. I use Alt+M for Modify, and S for Save to Disk (I think that the default shortcut) - so I would press Alt+M, Enter, S. If I wanted to further automate I'd do it with AHK on Windows, on a Mac you could probably do it with Automator. BR |
Quote:
Quote:
Quote:
|
Thanks BlindBandit. As far as I can tell, iTunes 12.8 does not accept epubs and iBooks doesn't add the iTunesMetadata.plist to the original epub, but it does add it to the iBooks version.
|
| All times are GMT -4. The time now is 10:56 PM. |
Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.