Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 08-03-2024, 11:52 PM   #1
Majutsushi
Member
Majutsushi began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Aug 2023
Device: Kobo Clara HD, Kobo Libra Colour
[Metadata Source Plugin] Apple Books covers

I recently discovered that iTunes has an API that lets you search for books available on the Apple Books store, and makes high-resolution covers available for them. And so taking the idea from the Kindle hi-res covers plugin I decided to make this API available as Calibre plugin.

The nice thing about the API is that you don't need to know any Apple Books-specific identifier for a book, you can just search by title and/or author. The one downside is that the store is country-specific, so you may need to configure your country in the plugin's settings. I've also added an optional secondary country setting in case you often want to search for books from different countries. Unfortunately there's no way to just search all country stores.

If available in the metadata the plugin will first try to look up the book's ISBN directly, and if unsuccessful it will fall back to the search mentioned above.

Note that the API documentation says that there is a rate limit of about 20 requests per minute, although I haven't been able to trigger that yet. Configuring two countries means there will be more requests per search, so there is a chance that this will hit the rate limit earlier.

The source is available here: https://github.com/majutsushi/apple-books-covers
Attached Files
File Type: zip Apple.Books.covers-v0.2.0.zip (21.6 KB, 4293 views)

Last edited by Majutsushi; 08-12-2024 at 02:24 AM. Reason: New plugin version
Majutsushi is offline   Reply With Quote
Old 08-04-2024, 01:35 AM   #2
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 40,475
Karma: 156982136
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
I did some testing on 20 books with your plugin and it seems to return the same hi-res covers as the Kobo Metadata plugin in most cases. On 2 books, the Kobo Metadata plugin returned the correct hi-res covers and the Apple Books plugin returned an incorrect cover. On another book, the Apple Books plugin returned the correct hi-res cover and the Kobo Metadata plugin returned an incorrect cover.

Thanks very much for an useful addition to calibre's cover downloader toolset.

Edit: added a couple of images of cover options.
Attached Thumbnails
Click image for larger version

Name:	Screenshot 2024-08-03 214054.png
Views:	291
Size:	426.5 KB
ID:	209941   Click image for larger version

Name:	Screenshot 2024-08-03 214704.png
Views:	243
Size:	555.4 KB
ID:	209942  

Last edited by DNSB; 08-04-2024 at 01:48 AM. Reason: Attach image of cover downloads
DNSB is offline   Reply With Quote
Advert
Old 08-04-2024, 02:23 AM   #3
Majutsushi
Member
Majutsushi began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Aug 2023
Device: Kobo Clara HD, Kobo Libra Colour
Yeah it's probably expected that the ebooks in different stores will often have the same cover, but since this uses an official API it should hopefully be more reliable than scraping websites.
Majutsushi is offline   Reply With Quote
Old 08-05-2024, 12:27 PM   #4
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 76,366
Karma: 136006198
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Can we get hi-res covers from Apple? It looks like then the eBook cover is low-res, so is the cover from Apple Books. When the eBook cover is hi-res, I get a hi-res cover. Is this the way it is?

Last edited by JSWolf; 08-05-2024 at 12:31 PM.
JSWolf is offline   Reply With Quote
Old 08-05-2024, 02:48 PM   #5
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 40,475
Karma: 156982136
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
From my testing, most of the Apple books use the same cover as this plugin returns. What the publisher supplies is what you get.
DNSB is offline   Reply With Quote
Advert
Old 08-05-2024, 09:04 PM   #6
Majutsushi
Member
Majutsushi began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Aug 2023
Device: Kobo Clara HD, Kobo Libra Colour
Yes, the plugin tries to get the highest-resolution cover it can find, which in my tests is usually the same resolution as the equivalent result from the Kindle and Kobo stores. But as DNSB said it always depends on the publisher.
Majutsushi is offline   Reply With Quote
Old 08-06-2024, 06:15 AM   #7
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 76,366
Karma: 136006198
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Majutsushi View Post
Yes, the plugin tries to get the highest-resolution cover it can find, which in my tests is usually the same resolution as the equivalent result from the Kindle and Kobo stores. But as DNSB said it always depends on the publisher.
Next question.

What makes the plugin sometimes only download 1 cover and sometimes more covers? I'm set to 2 covers and US/UK.
JSWolf is offline   Reply With Quote
Old 08-06-2024, 01:42 PM   #8
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 40,475
Karma: 156982136
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by JSWolf View Post
Next question.

What makes the plugin sometimes only download 1 cover and sometimes more covers? I'm set to 2 covers and US/UK.
The number of covers seen would depend on what the Apple API returns. With your settings, you will get from 0 to 2 covers. When I tested a couple of books with Canada/UK, I got the North American and British covers which were different.
DNSB is offline   Reply With Quote
Old 08-07-2024, 12:33 AM   #9
Majutsushi
Member
Majutsushi began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Aug 2023
Device: Kobo Clara HD, Kobo Libra Colour
Quote:
Originally Posted by JSWolf View Post
What makes the plugin sometimes only download 1 cover and sometimes more covers? I'm set to 2 covers and US/UK.
If the plugin finds an exact ISBN match then it will only download that cover, otherwise it will do a search and return the number of configured covers. I've been wondering if it should (optionally) do a search in the first case as well in case there are alternate editions with other covers available, so if that's something that people would find useful then I could add that. The main downside of that is that it will increase the risk of running into the API rate limit.
Majutsushi is offline   Reply With Quote
Old 08-07-2024, 07:53 PM   #10
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 76,366
Karma: 136006198
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Majutsushi View Post
If the plugin finds an exact ISBN match then it will only download that cover, otherwise it will do a search and return the number of configured covers. I've been wondering if it should (optionally) do a search in the first case as well in case there are alternate editions with other covers available, so if that's something that people would find useful then I could add that. The main downside of that is that it will increase the risk of running into the API rate limit.
I set the number of covers to 2 and US/UK so I would get a US and UK cover.

A lot of time the covers are different and sometimes I US cover is better or the UK cover is better. So I want to be able to choose which cover if they are hi-res.

Yes, I would like to be able to download both covers.

I thought I should already be able to and it was just broken that it didn't work. Others will see the settings the same way I did and find it's broken. It really is broken even thought the programming says it's not because the programming is not following the options.

Last edited by JSWolf; 08-07-2024 at 07:55 PM.
JSWolf is offline   Reply With Quote
Old 08-07-2024, 08:38 PM   #11
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 40,475
Karma: 156982136
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
I tried setting the first source to Canada and the second source to UK. I've left the number of covers at the default of 5. Downloading the covers from Apple only for J. D. Robb's Dark in Death returned 10 covers. The two covers for Dark in Death were the North American and UK covers. See attached images from Kobo (Amazon, etc. showed the same NA/UK covers).

Sadly, B&N still seems to think the 428x700 is a hi-res image.
Attached Thumbnails
Click image for larger version

Name:	Screenshot 2024-08-07 163107.png
Views:	215
Size:	620.8 KB
ID:	210011   Click image for larger version

Name:	Screenshot 2024-08-07 163710.png
Views:	195
Size:	281.7 KB
ID:	210014   Click image for larger version

Name:	Screenshot 2024-08-07 163732.png
Views:	195
Size:	248.8 KB
ID:	210015  

Last edited by DNSB; 08-07-2024 at 08:41 PM.
DNSB is offline   Reply With Quote
Old 08-09-2024, 02:58 AM   #12
Majutsushi
Member
Majutsushi began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Aug 2023
Device: Kobo Clara HD, Kobo Libra Colour
The plugin currently only downloads a single cover if it finds an ISBN match because I thought that getting the right cover for the specific edition was enough and I wanted to reduce the number of queries due to the rate limit, but I agree that the covers for alternative editions can also be desirable. As for why in DNSB's case it returns 10 covers instead of 5 that's because the limit is per-store, not absolute, which I probably should have made clearer.

Here's a version where I made some changes around this:
* It now always does a search, even if there's an ISBN match, to allow for alternative covers.
* It always returns at most the actual number of covers configured.
* If two stores are configured, it will prioritize the first results from each, since those are going to be the most relevant ones.

With these changes, if I configure the stores to be US and UK with two max covers, I get exactly the two US and UK covers for DNSB's book.

Unless someone finds a bug with this I'll release it as the next version, although I'm not sure if I can currently edit my initial post to change the attachment.
Attached Files
File Type: zip Apple.Books.covers-v0.1.0-1-ge618477-dirty.zip (21.6 KB, 187 views)
Majutsushi is offline   Reply With Quote
Old 08-12-2024, 02:26 AM   #13
Majutsushi
Member
Majutsushi began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Aug 2023
Device: Kobo Clara HD, Kobo Libra Colour
I have now released the above changes as version 0.2.0 and edited the initial post, so presumably the plugin should automatically update for people who installed it with the plugin manager (or even if not? I'm not sure).
Majutsushi is offline   Reply With Quote
Old 08-12-2024, 12:36 PM   #14
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 40,475
Karma: 156982136
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
The plug-in updated message showed up here.
DNSB is offline   Reply With Quote
Old 08-20-2024, 06:04 PM   #15
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 76,366
Karma: 136006198
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Majutsushi View Post
I have now released the above changes as version 0.2.0 and edited the initial post, so presumably the plugin should automatically update for people who installed it with the plugin manager (or even if not? I'm not sure).
Thank you. I now have the updated plugin and it's working well.
JSWolf is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Metadata Source Plugin] Skoob Books thiago.eec Plugins 23 08-27-2024 02:04 PM
[Metadata Source Plugin] Kindle (Amazon) High-res Covers lbschenkel Plugins 107 02-13-2024 09:01 PM
[Metadata Source Plugin] Kobo Books davidfor Plugins 201 10-17-2023 12:19 PM
How do I know which Metadata Source Plugin was called from fetch-ebook-metadata? eryMpexI Library Management 6 04-22-2023 09:58 AM
[Metadata Source Plugin] Empty Plugin? (Fake Identifier) mneimeyer Plugins 3 11-11-2019 09:07 PM


All times are GMT -4. The time now is 07:31 AM.


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