mirror of
https://github.com/searxng/searxng.git
synced 2025-08-03 18:42:33 +02:00
Youtube's unit test
This commit is contained in:
parent
8f040e30ad
commit
4dba3739fb
3 changed files with 207 additions and 2 deletions
|
@ -57,7 +57,7 @@ def response(resp):
|
|||
url = [x['href'] for x in result['link'] if x['type'] == 'text/html']
|
||||
|
||||
if not url:
|
||||
return
|
||||
continue
|
||||
|
||||
# remove tracking
|
||||
url = url[0].replace('feature=youtube_gdata', '')
|
||||
|
@ -73,7 +73,7 @@ def response(resp):
|
|||
pubdate = result['published']['$t']
|
||||
publishedDate = parser.parse(pubdate)
|
||||
|
||||
if result['media$group']['media$thumbnail']:
|
||||
if 'media$thumbnail' in result['media$group']:
|
||||
thumbnail = result['media$group']['media$thumbnail'][0]['url']
|
||||
|
||||
content = result['content']['$t']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue