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 04-21-2023, 07:32 AM   #1
eryMpexI
Junior Member
eryMpexI began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Apr 2023
Device: PDF reader on Windows
How do I know which Metadata Source Plugin was called from fetch-ebook-metadata?

Hello everybody,
I'm running fetch-ebook-metadata from Shell:

Code:
fetch-ebook-metadata --isbn="${ISBN}" --opf 2>/dev/null
Occasionally, the script fails with this error:

Quote:
-:26.1: Extra content at the end of the document
Failed to get cached URL from google for URL: https://www.amazon.com/Norton-Read
I don't know which metadata plugin throws this error.

The forum says:

Quote:
You can obtain the plugin error details by starting Calibre in debug mode
But I'm not starting the whole Calibre app, just fetch-ebook-metadata.

What's the best approach to troubleshoot this?

Ideally, I would configure the Shell script to restrict the run to one plugin each time using --allowed-plugin, see what result I get, and only use a different source if the request fails, but it's not something I can code right now.
So, I wonder how to know this
eryMpexI is offline   Reply With Quote
Old 04-21-2023, 08:01 AM   #2
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: 43,942
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Use the --verbose option and examine the log
kovidgoyal is offline   Reply With Quote
Advert
Old 04-22-2023, 06:24 AM   #3
eryMpexI
Junior Member
eryMpexI began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Apr 2023
Device: PDF reader on Windows
Quote:
Originally Posted by kovidgoyal View Post
Use the --verbose option and examine the log
Thanks.
Follow up question:

Is there a way to silence errors and get only the metadata?
The utility outputs failures like so, until it finds a valid source:

Quote:
Failed to get cached URL from google for URL: https://www.amazon.com/Peyote-Mescaline-Drugs-Straight-Facts/dp/0791085457 with error: HTTP Error 429: Too Many Requests
Failed to get cached URL from google for URL: https://www.amazon.com/Essential-Homer-Hackett-Classics/dp/0872205401 with error: HTTP Error 429: Too Many Requests
Failed to get cached URL from google for URL: https://www.amazon.com/Norton-Anthology-American-Literature-8th/dp/0393918858 with error: HTTP Error 429: Too Many Requests
Title : Peyote and Mescaline
Author(s) : M. Foster Olive
....
Is there a way to tell the utility to not print stderr?

Thank you
eryMpexI is offline   Reply With Quote
Old 04-22-2023, 08:52 AM   #4
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: 43,942
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
redirect stderr to /dev/null
kovidgoyal is offline   Reply With Quote
Old 04-22-2023, 08:55 AM   #5
eryMpexI
Junior Member
eryMpexI began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Apr 2023
Device: PDF reader on Windows
Quote:
Originally Posted by kovidgoyal View Post
redirect stderr to /dev/null
I have.
It doesn't work, you can see in my original message:

Code:
2>/dev/null
So, this stream is written to stdout, not sterr:

Quote:
Failed to get cached URL from google for URL:
That's why I asked
eryMpexI is offline   Reply With Quote
Advert
Old 04-22-2023, 08:56 AM   #6
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: 43,942
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
| grep -v '^Failed'
kovidgoyal is offline   Reply With Quote
Old 04-22-2023, 08:58 AM   #7
eryMpexI
Junior Member
eryMpexI began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Apr 2023
Device: PDF reader on Windows
Quote:
Originally Posted by kovidgoyal View Post
| grep -v '^Failed'
Thanks, I ended up doing something similar (in Shell), using awk to match only the XML:

Code:
fetch-ebook-metadata --isbn="${ISBN}" --opf | awk '/<?xml/,/package>/'
eryMpexI is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Metadata Source Plugin] INMONDADORI Pr.BarnArt Plugins 7 12-03-2021 12:56 PM
Read a book's metadata in a Metadata source plugin? J-H Development 2 03-30-2021 09:08 AM
[Metadata Source Plugin] Pitaval.cz (cz,sk) Miisha Plugins 2 01-01-2021 10:48 AM
[Metadata Source Plugin] Empty Plugin? (Fake Identifier) mneimeyer Plugins 3 11-11-2019 08:07 PM
Call fetch/download metadata from GUI plugin BeckyEbook Development 0 02-03-2017 06:51 PM


All times are GMT -4. The time now is 12:57 PM.


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