Repository: internetarchive/openlibrary

Issue:
ImportBot importing non-covers
Sometimes ImportBot imports placeholder covers. Can we check the url before importing the cover? These likely are all the same url.

### Evidence / Screenshot (if possible)
![image](https://user-images.githubusercontent.com/6251786/151876429-c108301b-7f9e-4851-b4c0-ddc5aa0e5bfa.png)

### Relevant url?
https://openlibrary.org/works/OL27276169W/The_Modern_Presidency

### Proposal & Constraints
<!-- What is the proposed solution / implementation? Is there a precedent of this approach succeeding elsewhere? -->

### Related files

### Stakeholders
@mekarpeles 


Discussion:
The relevant code should be here:
https://github.com/internetarchive/openlibrary/blob/master/openlibrary/core/vendors.py#L244

It seems like the image came from:
https://www.amazon.com/Modern-Presidency-Debates-Define-Institution/dp/0231206666

The url maybe is always the same?...
We're seeing: https://images-na.ssl-images-amazon.com/images/I/01RmK+J4pJL._BO1,204,203,200_.gif

We can remove the size info if we need to:
https://images-na.ssl-images-amazon.com/images/I/01RmK+J4pJL.gif

Extra credit.
Task is to basically check that the cover is not that url. Otherwise, it's a common enough case that we should consider getting the checksum of the image which we could do through an HTTP HEAD and then not set the cover.
I would like to work on this one
I was thinking about adding a static check for the url?
what do you think about that?
I will check for other amazon books with 'no images available' photo.
I found more product with no images 
https://www.amazon.com/Family-Drama-Stories-Delhi-Season/dp/B09QV94P8H/ref=sr_1_52?crid=31A13RN06YRDK&keywords=shashi&qid=1643898630&s=books&sprefix=shashi%2Cstripbooks-intl-ship%2C276&sr=1-52,
https://www.amazon.com/Holistic-Approach-Quantum-Cryptography-Security/dp/1032253924/ref=sr_1_74?crid=31A13RN06YRDK&keywords=shashi&qid=1643898859&s=books&sprefix=shashi%2Cstripbooks-intl-ship%2C276&sr=1-74,
https://www.amazon.com/Rabindranath-Tagore-Shashi-Ambaru-ebook/dp/B071XHBW4W/ref=sr_1_202?keywords=shashi&qid=1643908933&s=books&sr=1-202

If we compare url's of these images.
https://images-na.ssl-images-amazon.com/images/I/01RmK+J4pJL.gif
https://m.media-amazon.com/images/I/01RmK+J4pJL.gif
https://images-na.ssl-images-amazon.com/images/I/01RmK+J4pJL._BO1,204,203,200_.gif
https://m.media-amazon.com/images/I/01RmK+J4pJL.gif


Filename '01RmK+J4pJL.gif'
although this data is not enough to put a static check.
Go ahead! Unless @jimchamp had someone in mind.
@b2pacific would you like to take this one?
I was planning on giving this to @b2pacific (if they are interested).  They are looking for issues focused on the back-end.  My projects are mostly front-end, so I thought this would be a good one.

If @b2pacific is not interested, I will assign @tuminzee. 
@jimchamp I'll take this one. Thanks!

Resolving patch:
diff --git a/openlibrary/core/vendors.py b/openlibrary/core/vendors.py
--- a/openlibrary/core/vendors.py
+++ b/openlibrary/core/vendors.py
@@ -241,12 +241,7 @@ def serialize(product):
                 and item_info.title
                 and getattr(item_info.title, 'display_value')
             ),
-            'cover': (
-                images
-                and images.primary
-                and images.primary.large
-                and images.primary.large.url
-            ),
+            'covers': (images.primary.large.url if images and images.primary and images.primary.large and images.primary.large.url and not '/01RmK+J4pJL.' in images.primary.large.url else None),
             'authors': attribution
             and [{'name': contrib.name} for contrib in attribution.contributors],
             'publishers': list({p for p in (brand, manufacturer) if p}),


Test patch: