biblioteq icon indicating copy to clipboard operation
biblioteq copied to clipboard

Direct support for ISBN-13 for cover images.

Open charabaruk opened this issue 7 months ago • 20 comments

Now that ISBNs are being issues with GS1 prefix 979, we can no longer rely on conversion to ISBN-10 for books issued with an ISBN-13. We should look into whether Amazon and Open Library can be queried for cover images using ISBN-13 and update the application to support this.

charabaruk avatar May 30 '25 23:05 charabaruk

I have a draft PR #406 that provides support for Open Library, but it looks like there's no simple way to do it for Amazon. As far as I can tell, using an ISBN-13 doesn't work like using an ISBN-10 or ASIN does for getting a cover image from Amazon.

charabaruk avatar May 31 '25 04:05 charabaruk

Can you update the script : Scripts/biblioteq-download-images-sqlite.sh for books beginning with 979?

I haven't been able to do it myself :-(

Thanks in advance.

meteos77 avatar Nov 04 '25 17:11 meteos77

How?

textbrowser avatar Nov 04 '25 18:11 textbrowser

Sorry, I'm the requester, not the developer :-) I have the impression that the Amazon site does not transmit the image with isbn13.

I'm another program that manages collections... I don't know the Perl language, so it's hard to say how they do it. I have the impression that gcstar retrieves the entire page and extracts the information it wants.

https://github.com/user-attachments/assets/6342682a-0073-463f-a6af-278b70e5c210

https://gitlab.com/GCstar/GCstar

Does this method inspire you?

meteos77 avatar Nov 05 '25 08:11 meteos77

No. The scripts don't have graphical interfaces.

textbrowser avatar Nov 05 '25 13:11 textbrowser

You need to find the links for longer ISBNs for Amazon and Open Library. This is your request so you need to do some homework.

textbrowser avatar Nov 05 '25 13:11 textbrowser

I tried a 13-digit ISBN for Amazon. It's probably somewhere. If you know it, the scripts will be improved because we can also extract the longer ISBN from the database.

textbrowser avatar Nov 06 '25 15:11 textbrowser

test for isbn13: 9791035804657 The URL provides access to the book's details: https://www.amazon.com/s?k=9791035804657

The URL for the image link is, in principle, unmanageable. https://www.amazon.com/Histoire-1re-Collectif/dp/B07QBXLVND/ref=sr_1_1?dib=eyJ2IjoiMSJ9.0pQG9vfoAZn-c-pc0DVZxw.bwzLBjJgUnrMg4iI_zvf5gsULN88YLzXKbHWEYz_FqU&dib_tag=se&keywords=9791035804657&qid=1762449114&sr=8-1

If I look at the details of the book, the image has a link type: https://m.media-amazon.com/images/I/51azQ5uQX3L.SX342_SY445_ML2.jpg

meteos77 avatar Nov 06 '25 17:11 meteos77

Yeah, that ain't going to help. Can't link 81SqGqSXcWL to the ISBN.

textbrowser avatar Nov 06 '25 17:11 textbrowser

I found an intermediary that provides the image URL:

project: https://github.com/w3slley/bookcover-api

curl -X GET "https://bookcover.longitood.com/bookcover/979-1035804657" {"url":"https://m.media-amazon.com/images/S/compressed.photo.goodreads.com/books/1678881427i/97579560.jpg"}

meteos77 avatar Nov 06 '25 17:11 meteos77

Yeah, not adding CURL into BQ.

textbrowser avatar Nov 06 '25 17:11 textbrowser

bash script

meteos77 avatar Nov 06 '25 17:11 meteos77

Need specifics. Like for ISBN, curl this. Those are two fetches for a single image.

textbrowser avatar Nov 06 '25 17:11 textbrowser

I don't know man too much work for images. I look later.

textbrowser avatar Nov 06 '25 17:11 textbrowser

Yes, I understand. It's not as simple as it used to be. Have a good day.

meteos77 avatar Nov 06 '25 17:11 meteos77

I need two downloads and if the first download is now misbegotten because it cannot direct to the correct link, the second fetch has to understand the manner in which the error is defined. Or maybe the format changed. And this doesn't even address Open Library.

textbrowser avatar Nov 06 '25 17:11 textbrowser

https://webservices.amazon.com/paapi5/documentation/images.html

textbrowser avatar Nov 06 '25 17:11 textbrowser

https://webservices.amazon.com/paapi5/documentation/use-cases/search-with-external-identifiers.html

textbrowser avatar Nov 06 '25 17:11 textbrowser

You need maybe two queries. 1. Translate the ISBN into an ASIN. 2. Download the image with an ASIN search.

textbrowser avatar Nov 06 '25 17:11 textbrowser

The second link suggests that one search would suffice because you can specify the ISBN.

textbrowser avatar Nov 06 '25 17:11 textbrowser