forked from Icycoide/searxng
[fix] brave.news
This commit is contained in:
parent
140125e641
commit
27477f51fd
2 changed files with 5 additions and 4 deletions
|
@ -219,8 +219,7 @@ def response(resp):
|
|||
json_resp = json_data[1]['data']['body']['response']
|
||||
|
||||
if brave_category == 'news':
|
||||
json_resp = json_resp['news']
|
||||
return _parse_news(json_resp)
|
||||
return _parse_news(json_resp['news'])
|
||||
|
||||
if brave_category == 'images':
|
||||
return _parse_images(json_resp)
|
||||
|
@ -299,7 +298,7 @@ def _parse_news(json_resp):
|
|||
'title': result['title'],
|
||||
'content': result['description'],
|
||||
}
|
||||
if result['thumbnail'] != "null":
|
||||
if result['thumbnail'] is not None:
|
||||
item['img_src'] = result['thumbnail']['src']
|
||||
result_list.append(item)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue