Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 08-03-2016, 05:09 PM   #1
kassart
Junior Member
kassart began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Aug 2016
Device: Motorola Xoom
Fetching metadata with CLI

I know about fetch-ebook-metadata, but I can't figure out how to use it properly with my library. What exactly do I need to do to fetch and attach the downloaded metadata?

I need to do this with a CLI as I run calibre on my headless ubuntu server.

I installed from the official calibre site, I did not use the package in apt.
kassart is offline   Reply With Quote
Old 08-03-2016, 06:11 PM   #2
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
`fetch-ebook-metadata` is not a CLI for the library, it is a CLI for individual books.
  1. You can use ebook-meta or `calibredb show_metadata $id` or read the OPF file, in order to get the current title/author/ISBN for a book.
  2. Then `fetch-ebook-metadata` can retrieve new metadata from online, and print it to OPF format.
  3. `ebook-meta` or `calibredb set_metadata` can then save the retrieved metadata using the OPF from step two.

Last edited by eschwartz; 08-03-2016 at 10:01 PM. Reason: consistent ordering
eschwartz is offline   Reply With Quote
Advert
Old 08-03-2016, 08:31 PM   #3
kassart
Junior Member
kassart began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Aug 2016
Device: Motorola Xoom
I got through to step 2, but where does it save the metadata opf? It wasn't in my active directory
kassart is offline   Reply With Quote
Old 08-03-2016, 09:12 PM   #4
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
It is printed to stdout (did you try it and see?), so you will have to redirect it to a tmpfile or perhaps do something with named pipes.
eschwartz is offline   Reply With Quote
Old 08-03-2016, 09:13 PM   #5
kassart
Junior Member
kassart began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Aug 2016
Device: Motorola Xoom
I used "-o test.opf" and the opf was nowhere to be found
kassart is offline   Reply With Quote
Advert
Old 08-03-2016, 09:56 PM   #6
kassart
Junior Member
kassart began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Aug 2016
Device: Motorola Xoom
Ok so I think I got it with
Code:
$ fetch-ebook-metadata -t "title" -a "author" -o metadata.opf > metadata.opf
$ ebook-meta --from-opf metadata.opf "/path/to/book"
But now I have restarted my server and the new metadata isn't showing up in the book whose metadata I edited. What did I do wrong? The ebook-meta displayed original and changed metadata.
kassart is offline   Reply With Quote
Old 08-03-2016, 10:03 PM   #7
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
`ebook-meta` only modifies the metadata inside the book, not the library metadata. This is true in the GUI and it doesn't change when using the command-line.

That is why my instructions above referenced the `calibredb` commands, for manipulating the metadata inside the calibre library database.
eschwartz is offline   Reply With Quote
Old 08-03-2016, 10:08 PM   #8
kassart
Junior Member
kassart began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Aug 2016
Device: Motorola Xoom
See you put ebook-meta first so I figured it would be the better of the commands
kassart is offline   Reply With Quote
Old 08-03-2016, 10:13 PM   #9
kassart
Junior Member
kassart began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Aug 2016
Device: Motorola Xoom
That worked though, thank you very much for your help
kassart is offline   Reply With Quote
Old 08-03-2016, 10:36 PM   #10
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by kassart View Post
See you put ebook-meta first so I figured it would be the better of the commands
I guess that is true, sorry.

Nevertheless, it is always a good idea to check the help for any command you have just learned about, rather than simply running it blindly.
eschwartz is offline   Reply With Quote
Reply

Tags
cli, metadata


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Metadata Source Plugin] Amazon.com not fetching all descriptions StillReading Calibre 4 01-09-2016 08:02 AM
Saving metadata and covers with the cli interface not working properly Kode Calibre 9 11-09-2014 06:29 PM
Prevent downloading tags when fetching metadata? Hi! Calibre 4 09-06-2009 08:42 AM
Adding online metadata using ISBN from CLI EditorJack Calibre 17 01-20-2009 01:47 AM


All times are GMT -4. The time now is 04:34 PM.


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