Merge pull request #119 from crisisking/youtube_no_results
Accounts for situations where no youtube videos are returned.
This commit is contained in:
commit
68341a7655
|
@ -75,7 +75,7 @@ def youtube(inp):
|
|||
if 'error' in j:
|
||||
return 'error while performing the search'
|
||||
|
||||
if j['data']['totalItems'] == 0:
|
||||
if j['data']['totalItems'] == 0 or 'items' not in j['data']:
|
||||
return 'no results found'
|
||||
|
||||
vid_id = j['data']['items'][0]['id']
|
||||
|
|
Loading…
Reference in New Issue