Merge pull request #119 from crisisking/youtube_no_results

Accounts for situations where no youtube videos are returned.
This commit is contained in:
Ryan Hitchman 2014-11-07 22:25:46 -08:00
commit 68341a7655
1 changed files with 1 additions and 1 deletions

View File

@ -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']