![]() |
#1 | |
Enthusiast
![]() Posts: 34
Karma: 10
Join Date: Aug 2022
Device: Windows 10
|
Adding Cover by URL When adding books
Hello,
I'm wondering if it is possible to add a book cover by URL not by a file path when adding a book with the calibredb add command. I could successfully add a cover with a file path using the --cover option. But when I try to specify a URL instead of a file path, it gives an error. Quote:
|
|
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,355
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
There are gazillions of command line tools that can download a URL. Use any of then and then call calibredb with the downloaded cover.
|
![]() |
![]() |
![]() |
#3 |
Enthusiast
![]() Posts: 34
Karma: 10
Join Date: Aug 2022
Device: Windows 10
|
Thanks for the comment.
That's what I'm doing currently. But you know, you have to validate the downloaded image file to ensure it's not broken and delete it after confirming that the book has been successfully added to the database. These might be better to be handled by experienced programmers. If this is done on the Calibre side, it would be great. |
![]() |
![]() |
![]() |
#4 | |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 46,223
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
Also out of curiosity, where is the URL coming from? |
|
![]() |
![]() |
![]() |
#5 |
Enthusiast
![]() Posts: 34
Karma: 10
Join Date: Aug 2022
Device: Windows 10
|
|
![]() |
![]() |
![]() |
#6 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 46,223
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
The you in my comment was not you personally but a generic you as in a calibre user.
Umm... just how is calibre going to validate the cover image for all the users? I won't ask you to write the code but perhaps you could generate a simple flow diagram of how you would program the image insertion code to be able to distinguish a "good" cover from a "bad" cover. Don't forget to allow for tasks such as distinguishing image quality, image size, colour depth, etc. that we currently use wetware to handle. Make sure that you include the code paths needed to analyze the image file to locate strings of text to match to the author(s), editor(s), book title, series title and index, etc. to ensure that you have a cover image that matches the book. You may also want to familiarize yourself with the current state of the art in image recognition and the current software patents in this area. In simple words, what you are asking for is not a simple task. For your original query, with the current state of calibre development, how would you know that the URL you want to use to download the image has a valid, reasonably sized image if you haven't visited the page and examined the image for yourself? |
![]() |
![]() |
![]() |
#7 | ||||
Enthusiast
![]() Posts: 34
Karma: 10
Join Date: Aug 2022
Device: Windows 10
|
Quote:
Quote:
When downloading the specified image fails, do the normal cover finding task like it does when the --cover option is not set. Quote:
Quote:
2. Download the image. 3. Check if it is not broken. 4-a. Add it to Calibre with the book. 4-b. If it is broken or the given URL is not available, do the normal adding book task without the --cover option. |
||||
![]() |
![]() |
![]() |
#8 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,355
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Any decent file download tool will automatically check if the download is not broken in the sense you mean. Again, just use one.
|
![]() |
![]() |
![]() |
#9 | |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 46,223
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
I didn't ask you to write the code. I asked you for a flow diagram or flowchart which is a lot simpler task. Ask any programmer whom has been handed one. I thought this might get you to think about what you are actually asking for. The best way at the moment to do a decent job of verifying a cover image is to use the mark one eyeball. In which case, downloading the image and pointing calibre at that file would make more sense than copying the URL. |
|
![]() |
![]() |
![]() |
#10 | ||||
Enthusiast
![]() Posts: 34
Karma: 10
Join Date: Aug 2022
Device: Windows 10
|
Quote:
Quote:
Quote:
Quote:
|
||||
![]() |
![]() |
![]() |
#11 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,062
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
You seem to be Ignoring advice by folk who Designed Calibre and its features or plugins.
Your work flow seemed odd to me (and I am not a Developer), and I have been using Calibre for over 10Y (and seen many suggestions ADOPTED). |
![]() |
![]() |
![]() |
#12 |
Enthusiast
![]() Posts: 34
Karma: 10
Join Date: Aug 2022
Device: Windows 10
|
|
![]() |
![]() |
![]() |
#13 |
Still reading
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 14,045
Karma: 105092227
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
|
I either don't understand what you want, or if I do understand, it makes no sense. Use wget or browser to download by URL and how would you generally know what the URL is for a cover anyway?
There at least 6 ways to add a cover: 1) It's in the ebook file already and automatic when you add the ebook 2) You can go to Download in Edit Metadata and the usual book places are searched and you click on result you want. 3) Create a Generic cover from title & author in Edit Metadata 4) Browse to a directory where you have saved covers/images and pick one. 5) A cover creator addin that lets you create or edit a cover 6) Go to image editor of choice on your system via the cover thumnail even if there is no cover. Where does this url you want to load from come from? See wget (can be added to Windows and installed by default on Linux). |
![]() |
![]() |
![]() |
#14 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,729
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
@tn4w - in Powershell, you could try piping wget output into a calibredb add --cover command. Curious - can one create a new book by adding a format file and a cover in the one command? e.g. calibredb add -c mycover.jpg mybook.epub. FWIW: we should be encouraging people to step out of the (come in spinner) DOS Box into the brave new world of the Power Shell - at 16 it's old enough to take for a test drive ![]() BR Last edited by BetterRed; 12-09-2022 at 03:35 PM. |
|
![]() |
![]() |
![]() |
#15 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,758
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
I find it's a lot easier to use Calibre (with various plugins) to look for and download covers. Most of the time it finds an appropriate hi-res cover. And the GUI is just so very much easier to use then the command line.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Adding Metadata by Google Books and Amazon URL | Billa | Library Management | 3 | 11-06-2013 09:07 AM |
Disable cover generation when adding books in Calibre? | rebl | Library Management | 8 | 03-18-2013 06:56 AM |
Cover images dissappeared after adding some books from my Calibre library | fictionaddiction | Kobo Reader | 8 | 06-23-2011 10:42 AM |
Including book cover when adding books | Keith0603 | Calibre | 11 | 05-23-2011 12:10 AM |
adding books cover comments | icwright | Calibre | 5 | 12-22-2009 06:48 PM |