From b08b81b4349b64b2b42f0a52a2c7f76073d4ffc3 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sat, 19 Feb 2022 20:14:31 +0100 Subject: [PATCH] [mod] bandcamp & genius: in result set img_src instead thumbnail Suggested-by: @dalf https://github.com/searxng/searxng/pull/900#issuecomment-1046009057 Signed-off-by: Markus Heiser --- searx/engines/bandcamp.py | 2 +- searx/engines/genius.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/searx/engines/bandcamp.py b/searx/engines/bandcamp.py index f83ca6d4f..8feff1fe0 100644 --- a/searx/engines/bandcamp.py +++ b/searx/engines/bandcamp.py @@ -82,7 +82,7 @@ def response(resp): thumbnail = result.xpath('.//div[@class="art"]/img/@src') if thumbnail: - new_result['thumbnail'] = thumbnail[0] + new_result['img_src'] = thumbnail[0] result_id = parse_qs(urlparse(link.get('href')).query)["search_item_id"][0] itemtype = extract_text(result.xpath('.//div[@class="itemtype"]')).lower() diff --git a/searx/engines/genius.py b/searx/engines/genius.py index 2cdc686a7..db1f66603 100644 --- a/searx/engines/genius.py +++ b/searx/engines/genius.py @@ -51,7 +51,7 @@ def parse_lyric(hit): 'url': hit['result']['url'], 'title': hit['result']['full_title'], 'content': content, - 'thumbnail': hit['result']['song_art_image_thumbnail_url'], + 'img_src': hit['result']['song_art_image_thumbnail_url'], } if timestamp: result.update({'publishedDate': datetime.fromtimestamp(timestamp)}) @@ -69,7 +69,7 @@ def parse_artist(hit): 'url': hit['result']['url'], 'title': hit['result']['name'], 'content': '', - 'thumbnail': hit['result']['image_url'], + 'img_src': hit['result']['image_url'], } return result @@ -85,7 +85,7 @@ def parse_album(hit): return { 'url': res['url'], 'title': res['full_title'], - 'thumbnail': res['cover_art_url'], + 'img_src': res['cover_art_url'], 'content': content.strip(), }