Amazon metadata download: Switch the default backend to bing

Google discontinued its webcache and Wayback machine's webcache is
currently broken. And lots of google search result URLs are not indexed
in the bing web cache. So search using bing instead.
This commit is contained in:
Kovid Goyal 2024-10-18 13:59:50 +05:30
parent 75d31bb235
commit 761e2b5c6f
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1090,7 +1090,7 @@ class Worker(Thread): # Get details {{{
class Amazon(Source):
name = 'Amazon.com'
version = (1, 3, 9)
version = (1, 3, 10)
minimum_calibre_version = (2, 82, 0)
description = _('Downloads metadata and covers from Amazon')
@ -1559,13 +1559,17 @@ class Amazon(Source):
domain)[len('https://'):].partition('/')[0]
matches = []
server = override_server or self.server
urlproc, sfunc = se.google_url_processor, se.google_search
if server == 'bing':
urlproc, sfunc = se.bing_url_processor, se.bing_search
elif server == 'wayback':
urlproc, sfunc = se.wayback_url_processor, se.ddg_search
elif server == 'ddg':
urlproc, sfunc = se.ddg_url_processor, se.ddg_search
elif server == 'google':
urlproc, sfunc = se.google_url_processor, se.google_search
else: # auto or unknown
# urlproc, sfunc = se.google_url_processor, se.google_search
urlproc, sfunc = se.bing_url_processor, se.bing_search
try:
results, qurl = sfunc(terms, site, log=log, br=br, timeout=timeout)
except HTTPError as err: