Merge pull request #715 from joksnet/no_video_results

[YT Search] No results if items is not in response
This commit is contained in:
Philipp Hagemeister 2013-02-26 10:43:35 -08:00
commit 790d4fcbe1

View file

@ -1478,6 +1478,10 @@ class YoutubeSearchIE(InfoExtractor):
return return
api_response = json.loads(data)['data'] 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']) new_ids = list(video['id'] for video in api_response['items'])
video_ids += new_ids video_ids += new_ids