aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2013-02-26 10:43:35 -0800
committerPhilipp Hagemeister <phihag@phihag.de>2013-02-26 10:43:35 -0800
commit790d4fcbe1559606d35bad20120e230b4223aa91 (patch)
treeeb70beeaf61ab413871989bdf2b38feb61236595
parentf03b88b3fb67a14998186787ba5c90f3e2c96a7b (diff)
parent9e07cf2955ce3fc7dc7c4676ec32da9bfd6e3990 (diff)
downloadyoutube-dl-790d4fcbe1559606d35bad20120e230b4223aa91.tar.xz
Merge pull request #715 from joksnet/no_video_results
[YT Search] No results if items is not in response
-rwxr-xr-xyoutube_dl/InfoExtractors.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/youtube_dl/InfoExtractors.py b/youtube_dl/InfoExtractors.py
index d661d517d..a9646433e 100755
--- a/youtube_dl/InfoExtractors.py
+++ b/youtube_dl/InfoExtractors.py
@@ -1478,6 +1478,10 @@ class YoutubeSearchIE(InfoExtractor):
return
api_response = json.loads(data)['data']
+ if not 'items' in api_response:
+ self._downloader.trouble(u'[youtube] No video results')
+ return
+
new_ids = list(video['id'] for video in api_response['items'])
video_ids += new_ids