From 3f550d53824c7b80823ef7ecc0fee589c4acbbfd Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 28 Jul 2022 21:26:25 +0530 Subject: [PATCH] Check that search result urls startwith https://books.google Dont trust google web search to always return google books results --- src/calibre/ebooks/metadata/sources/google.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/metadata/sources/google.py b/src/calibre/ebooks/metadata/sources/google.py index 1be1bb9c3f..993d0d1766 100644 --- a/src/calibre/ebooks/metadata/sources/google.py +++ b/src/calibre/ebooks/metadata/sources/google.py @@ -411,7 +411,7 @@ class GoogleBooks(Source): google_ids = [] for q in se.google_parse_results(root, r[0], log=log, ignore_uncached=False): m = pat.search(q.url) - if m is None: + if m is None or not q.url.startswith('https://books.google'): continue google_ids.append(m.group(1))