![]() |
#1 |
Member
![]() Posts: 11
Karma: 10
Join Date: Aug 2010
Device: none
|
Autotagging with Calibre (command line)
Hello,
I am wondering if Calibre is able to set an epub's metadata using internet sources such as librarything, amazon, etc. I know that the GUI is able to do that, however due to QT's certain limitations I am not really able to use it that way. I am able to get book information using librarything and fetch-ebook-metadata, however I need a way to actually put the retrieved info into the .epub book itself. An alternative would be to edit the xml data directly, however that gets a bit tedious if you happen to have a large library. Erion |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,265
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Explore the rest of the command line interface it includes tools tp update metadata in book files and in the calibre db
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Member
![]() Posts: 11
Karma: 10
Join Date: Aug 2010
Device: none
|
Hello,
Thank you for your reply. Maybe it's just me, but I'm unable to find such an option. I saw the option to update metadata, but it's from an opf file, or from the command line itself via options (e.g. -t, -a, etc). This would work nicely if the tools which get metadata information would return for example an .opf file, but currently I have to redirect the output of either librarything or fetch-ebook-metadata to the StdOut, open the file in a text editor and call ebook-meta with the appropriate parameters based on the content of the saved file. Erion |
![]() |
![]() |
![]() |
#4 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 75,690
Karma: 134319572
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Librarything is hardly the most reliable source. I do have an account that I do not use because of some serious errors that the people in charge never felt like fixing after I reported a few times. Goodreads has librarians that actually respond and do fix errors.
|
![]() |
![]() |
![]() |
#5 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,265
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You'll have to write a small script to extract the info from the output of fetch-ebook-metadata shouldn't be too hard.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Member
![]() Posts: 11
Karma: 10
Join Date: Aug 2010
Device: none
|
Hello,
Thank you very much. Somehow I knew it'll end that way. ![]() Anyways, Calibre is by far the best! Erion |
![]() |
![]() |
![]() |
#7 |
Member
![]() Posts: 11
Karma: 10
Join Date: Aug 2010
Device: none
|
Hello,
My script is working fine now, except for the comment. A book has usually a description which spawns more lines, but Microsoft's command line has a serious limitation whereas it interprets a new line character as a new command. This results in a comment tag which has the first line of the comment, while the rest is ignored. Does Calibre have a special character which could signify a new line, and which is accepted by the standard windows command line interpreter (cmd)? Erion |
![]() |
![]() |
![]() |
#8 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,265
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
why not redirect the output to a file?
|
![]() |
![]() |
![]() |
#9 |
Member
![]() Posts: 11
Karma: 10
Join Date: Aug 2010
Device: none
|
Hello,
You mean the input... No, sadly ebook-meta won't accept commands from the StdIn when I specify a file, e.g. Code:
ebook-meta <file.txt |
![]() |
![]() |
![]() |
#10 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,265
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
No I meant write out the metadata as an opf file (it's a simple xml file) and use --from-opf option of ebook-meta
|
![]() |
![]() |
![]() |
#11 |
Member
![]() Posts: 11
Karma: 10
Join Date: Aug 2010
Device: none
|
Hello,
Oh I see. Is there a sample .opf file somewhere I could use to convert the output of fetch-ebook-metadata? Erion |
![]() |
![]() |
![]() |
#12 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,553
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
|
You can always create one from within Calibre by using the Save to Disk command and ticking the option to create the .opf file.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Old Thread] Calibre Command line and .bat file | stratman | Calibre | 15 | 01-10-2012 05:38 PM |
Calibre Command Line usage with PHP | artoros | Related Tools | 13 | 07-01-2010 09:57 AM |
Specify liberary path in command line when launching calibre | rollercoaster | Calibre | 2 | 03-04-2010 12:08 AM |
Calibre Command Line Interface TOC | bcolflesh | Calibre | 3 | 02-04-2010 04:09 PM |
calibre command line utilities and calibre defaults | astrodad | Calibre | 2 | 08-07-2008 03:27 PM |