Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 12-21-2017, 05:20 PM   #1
drawson1
Connoisseur
drawson1 began at the beginning.
 
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
drawson1 is offline   Reply With Quote
Old 12-21-2017, 05:24 PM   #2
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
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
BetterRed is offline   Reply With Quote
Advert
Old 12-21-2017, 05:51 PM   #3
drawson1
Connoisseur
drawson1 began at the beginning.
 
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
drawson1 is offline   Reply With Quote
Old 12-21-2017, 05:54 PM   #4
drawson1
Connoisseur
drawson1 began at the beginning.
 
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
drawson1 is offline   Reply With Quote
Old 12-21-2017, 08:39 PM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is offline   Reply With Quote
Advert
Old 12-21-2017, 08:54 PM   #6
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
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.
davidfor is offline   Reply With Quote
Old 12-21-2017, 09:05 PM   #7
drawson1
Connoisseur
drawson1 began at the beginning.
 
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!
drawson1 is offline   Reply With Quote
Old 12-21-2017, 09:11 PM   #8
drawson1
Connoisseur
drawson1 began at the beginning.
 
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>[^_]+)
drawson1 is offline   Reply With Quote
Old 12-21-2017, 09:30 PM   #9
drawson1
Connoisseur
drawson1 began at the beginning.
 
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!
drawson1 is offline   Reply With Quote
Old 12-21-2017, 09:51 PM   #10
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by drawson1 View Post
@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>[^_]+)
With those options, calibre will attempt to read the metadata from within the book. If it can't then it will use the template. And for the example you gave, the template should put the file name into the title and calibre will set the author to "Unknown".

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.
davidfor is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 12:09 AM.


MobileRead.com is a privately owned, operated and funded community.