summaryrefslogtreecommitdiff
path: root/searx/engines/youtube.py
diff options
context:
space:
mode:
authorCqoicebordel <Cqoicebordel@users.noreply.github.com>2015-01-26 18:24:08 +0100
committerCqoicebordel <Cqoicebordel@users.noreply.github.com>2015-01-26 18:24:08 +0100
commit4dba3739fb3b98572cbd51adab226376b5844105 (patch)
treef9422c343c1f05193dad47113682a3e9599f4c84 /searx/engines/youtube.py
parent8f040e30adbbd615155a5075bec28ccadff10eff (diff)
downloadsearxng-4dba3739fb3b98572cbd51adab226376b5844105.tar.gz
searxng-4dba3739fb3b98572cbd51adab226376b5844105.zip
Youtube's unit test
Diffstat (limited to 'searx/engines/youtube.py')
-rw-r--r--searx/engines/youtube.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/searx/engines/youtube.py b/searx/engines/youtube.py
index 59f07c574..1375538a8 100644
--- a/searx/engines/youtube.py
+++ b/searx/engines/youtube.py
@@ -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']