mirror of
https://github.com/searxng/searxng.git
synced 2024-11-14 08:40:11 +01:00
[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 <markus.heiser@darmarit.de>
This commit is contained in:
parent
bded1ee280
commit
b08b81b434
@ -82,7 +82,7 @@ def response(resp):
|
|||||||
|
|
||||||
thumbnail = result.xpath('.//div[@class="art"]/img/@src')
|
thumbnail = result.xpath('.//div[@class="art"]/img/@src')
|
||||||
if thumbnail:
|
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]
|
result_id = parse_qs(urlparse(link.get('href')).query)["search_item_id"][0]
|
||||||
itemtype = extract_text(result.xpath('.//div[@class="itemtype"]')).lower()
|
itemtype = extract_text(result.xpath('.//div[@class="itemtype"]')).lower()
|
||||||
|
@ -51,7 +51,7 @@ def parse_lyric(hit):
|
|||||||
'url': hit['result']['url'],
|
'url': hit['result']['url'],
|
||||||
'title': hit['result']['full_title'],
|
'title': hit['result']['full_title'],
|
||||||
'content': content,
|
'content': content,
|
||||||
'thumbnail': hit['result']['song_art_image_thumbnail_url'],
|
'img_src': hit['result']['song_art_image_thumbnail_url'],
|
||||||
}
|
}
|
||||||
if timestamp:
|
if timestamp:
|
||||||
result.update({'publishedDate': datetime.fromtimestamp(timestamp)})
|
result.update({'publishedDate': datetime.fromtimestamp(timestamp)})
|
||||||
@ -69,7 +69,7 @@ def parse_artist(hit):
|
|||||||
'url': hit['result']['url'],
|
'url': hit['result']['url'],
|
||||||
'title': hit['result']['name'],
|
'title': hit['result']['name'],
|
||||||
'content': '',
|
'content': '',
|
||||||
'thumbnail': hit['result']['image_url'],
|
'img_src': hit['result']['image_url'],
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
|
|
||||||
@ -85,7 +85,7 @@ def parse_album(hit):
|
|||||||
return {
|
return {
|
||||||
'url': res['url'],
|
'url': res['url'],
|
||||||
'title': res['full_title'],
|
'title': res['full_title'],
|
||||||
'thumbnail': res['cover_art_url'],
|
'img_src': res['cover_art_url'],
|
||||||
'content': content.strip(),
|
'content': content.strip(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user