From b13307a96003ba15bbd88127e775f7be3832a0a3 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 25 Sep 2024 08:21:45 +0530 Subject: [PATCH] Dont use google webcache as google has discontinued it --- src/calibre/ebooks/metadata/sources/search_engines.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/calibre/ebooks/metadata/sources/search_engines.py b/src/calibre/ebooks/metadata/sources/search_engines.py index 32a3a22d87fa..e71eaacec723 100644 --- a/src/calibre/ebooks/metadata/sources/search_engines.py +++ b/src/calibre/ebooks/metadata/sources/search_engines.py @@ -31,7 +31,7 @@ from calibre.utils.lock import ExclusiveFile from calibre.utils.random_ua import accept_header_for_ua -current_version = (1, 2, 5) +current_version = (1, 2, 6) minimum_calibre_version = (2, 80, 0) webcache = {} webcache_lock = Lock() @@ -289,6 +289,7 @@ def google_cache_url_for_url(url): def google_get_cached_url(url, br=None, log=prints, timeout=60): + # Google's webcache was discontinued in september 2024 cached_url = google_cache_url_for_url(url) br = google_specialize_browser(br or browser()) try: @@ -327,8 +328,7 @@ def google_parse_results(root, raw, log=prints, ignore_uncached=True): if curl in seen: continue seen.add(curl) - cached_url = google_cache_url_for_url(curl) - ans.append(Result(a.get('href'), title, cached_url)) + ans.append(Result(a.get('href'), title, curl)) if not ans: title = ' '.join(root.xpath('//title/text()')) log('Failed to find any results on results page, with title:', title) @@ -413,7 +413,7 @@ def google_develop(search_terms='1423146786', raw_from=''): def get_cached_url(url, br=None, log=prints, timeout=60): - return google_get_cached_url(url, br, log, timeout) or wayback_machine_cached_url(url, br, log, timeout) + return wayback_machine_cached_url(url, br, log, timeout) def get_data_for_cached_url(url):