From 452093db4714eef03a990508bd2337e40b66fca3 Mon Sep 17 00:00:00 2001 From: Giulio De Pasquale Date: Thu, 8 Sep 2022 17:23:53 +0200 Subject: [PATCH] Google Covers: strip curl in thumbnail and request higher resolution image --- cps/metadata_provider/google.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cps/metadata_provider/google.py b/cps/metadata_provider/google.py index 98fadd37..10a3eeb0 100644 --- a/cps/metadata_provider/google.py +++ b/cps/metadata_provider/google.py @@ -103,6 +103,14 @@ class Google(Metadata): def _parse_cover(result: Dict, generic_cover: str) -> str: if result["volumeInfo"].get("imageLinks"): cover_url = result["volumeInfo"]["imageLinks"]["thumbnail"] + + # strip curl in cover + cover_url = cover_url.replace("&edge=curl", "") + + # request 800x900 cover image (higher resolution) + cover_url += "&fife=w800-h900" + + return cover_url.replace("http://", "https://") return generic_cover