![]() |
#1 |
Connoisseur
![]() Posts: 96
Karma: 10
Join Date: Mar 2014
Device: Libra H20, Clara 2E
|
Title for book with no metadata???
I'm working on some automated import tooling to copy books from Digital Editions to Calibre, and in the course of that, I found two books (out of ~1100 in my library) that have NO title metadata in the original epub. As an example:
Code:
$ exiftool epub/import/The_Rubaiyat_of_Omar_Khayyam.epub
ExifTool Version Number : 10.55
File Name : The_Rubaiyat_of_Omar_Khayyam.epub
Directory : epub/import
File Size : 1116 kB
File Modification Date/Time : 2017:05:06 06:48:13-04:00
File Access Date/Time : 2017:12:18 14:59:11-05:00
File Inode Change Date/Time : 2017:05:06 07:08:23-04:00
File Permissions : rw-r--r--
File Type : EPUB
File Type Extension : epub
MIME Type : application/zip
Zip Required Version : 10
Zip Bit Flag : 0
Zip Compression : None
Zip Modify Date : 2008:04:24 02:30:07
Zip CRC : 0x00000000
Zip Compressed Size : 0
Zip Uncompressed Size : 0
Zip File Name : khayyam-rubaiyat-00-h-dir/
Does anyone know how Calibre determines the title for these files? Is it just based on the file name? Thanks! Dan |
![]() |
![]() |
![]() |
#2 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,660
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
If add settings are set to get metadata from content it will probably default to 'Unknown'.
Suck it and see BR |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Connoisseur
![]() Posts: 96
Karma: 10
Join Date: Mar 2014
Device: Libra H20, Clara 2E
|
If I pull it in to calibre again, I get a title . . . . the author comes through as "Unknown".
Aside from path differences, the exiftool sees the same metadata for the imported and un-imported copies Dan |
![]() |
![]() |
![]() |
#4 |
Connoisseur
![]() Posts: 96
Karma: 10
Join Date: Mar 2014
Device: Libra H20, Clara 2E
|
Related note: I do get two warnings during "Add books":
WARNING: Epub doesn't contain a mimetype declaration EPubException: missing OCF container.xml file But it imports the file and figures out a title :-) Dan |
![]() |
![]() |
![]() |
#5 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,251
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
calibre contains lots and lots of code to get ebook metadata robustly. Why are you using exiftool rather than ebook-meta from calibre? I highly doubt exiftool is nearly as capable.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
@kovid: I think drawson1 is trying to work out why some books added to calibre are missing metadata and use exiftool to examine the original book to see what was in it.
@drawson1: Look in the preferences on the "Adding books to calibre" page. This has the options for how calibre gets metadata from books when they are added. There is an option to read the internal metadata. And there is template for getting the basic metadata from the file name. I don't remember what the default template looks like, but it is probably splitting the file name at dashes to give a title and author. As the file name you have doesn't have any dashes, you will only get one or the other. The best thing to do is import your books and look for the problems. Then either fix template and reimport those, or use the metadata download to get the correct title and author. I almost always use the latter. |
![]() |
![]() |
![]() |
#7 |
Connoisseur
![]() Posts: 96
Karma: 10
Join Date: Mar 2014
Device: Libra H20, Clara 2E
|
I'm trying to grab the metadata BEFORE the eBook is imported - that's where exiftool comes into play.
I've been playing with this a bit - there' must be LOTS of code to make this as robust as it is; in my own small collection (~1100 ebooks) I found SIX different tags used for "title". And I found commercial eBooks from a single publisher for a single author with three different spellings for the "creator" tags . . . . Thanks again for the help! |
![]() |
![]() |
![]() |
#8 |
Connoisseur
![]() Posts: 96
Karma: 10
Join Date: Mar 2014
Device: Libra H20, Clara 2E
|
@davidfor - I'm actually trying to automate the import from Digital Editions . . . I'd prefer that my little script does this as silently and robustly as possible
![]() The Add Books setup is the default, ie, the "Get metadata from file contents" checkbox is checked, and the regex for import from file name is: (?P<title>.+) - (?P<author>[^_]+) |
![]() |
![]() |
![]() |
#9 |
Connoisseur
![]() Posts: 96
Karma: 10
Join Date: Mar 2014
Device: Libra H20, Clara 2E
|
Oops - I just realized that ebook-meta will happily read the books I haven't imported yet . . . . .Duh - insert head-slap here!
I'll try that for my scripting - thanks! |
![]() |
![]() |
![]() |
#10 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
As to the rest, why? As you have discovered, there is a lot of work needed and calibre does it. Open the Digital Editions folder and drag-and-drop the books to the calibre window. For me, that works (almost) perfectly. The "almost" is if the metadata in the book is completely rubbish. Then I fix the title and author so that I can use download metadata to get the rest of the metadata. As an example, for the author spelling problem, after you have added them all, select them, open the bulk metadata editor, fix it and they are all OK. When you get another book with a variation on the name, use the metadata editor and select the correct name from the drop-down. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Help with Title -> Title Sort Metadata Editing | sehlat | Library Management | 3 | 07-07-2017 12:48 AM |
Calibre fills automatically title and author metadata in books without any metadata? | thosedays | Library Management | 5 | 10-28-2016 03:33 PM |
Edit Book: Handling of 'umlaut' in <title>Wilde Schw�ne</title> | chaot | Editor | 3 | 04-26-2016 12:34 PM |
Book title displays differently in Kindle after metadata change | ggurman | Library Management | 10 | 02-09-2016 02:10 PM |
Easiest way to add book/title/other metadata? | Fiat_Lux | Library Management | 1 | 01-17-2012 06:32 PM |