Skip to content

Commit

Permalink
Fix playlists with size 50i ∀ i∉ℕ (Closes #782)
Browse files Browse the repository at this point in the history
  • Loading branch information
phihag committed Apr 18, 2013
1 parent d22f654 commit feba604
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion youtube_dl/InfoExtractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -1778,9 +1778,13 @@ def _real_extract(self, url):
self._downloader.report_error(u'Invalid JSON in API response: ' + compat_str(err))
return

if not 'feed' in response or not 'entry' in response['feed']:
if 'feed' not in response:
self._downloader.report_error(u'Got a malformed response from YouTube API')
return
if 'entry' not in response['feed']:
# Number of videos is a multiple of self._MAX_RESULTS
break

videos += [ (entry['yt$position']['$t'], entry['content']['src'])
for entry in response['feed']['entry']
if 'content' in entry ]
Expand Down

0 comments on commit feba604

Please sign in to comment.