[fix] findthatmeme: hardening the response against KeyErrors (#5516)

This commit is contained in:
Austin-Olacsi
2025-12-03 23:13:05 -07:00
committed by GitHub
parent 1f6ea41272
commit aba839195b

View File

@@ -42,8 +42,8 @@ def response(resp):
results.append( results.append(
{ {
'url': item['source_page_url'], 'url': item.get('source_page_url'),
'title': item['source_site'], 'title': item.get('source_site'),
'img_src': img if item['type'] == 'IMAGE' else thumb, 'img_src': img if item['type'] == 'IMAGE' else thumb,
'filesize': humanize_bytes(item['meme_file_size']), 'filesize': humanize_bytes(item['meme_file_size']),
'publishedDate': formatted_date, 'publishedDate': formatted_date,