1
0
Fork 0
mirror of https://gitlab.com/dstftw/youtube-dl.git synced 2020-11-16 09:42:26 +00:00

YoutubePlaylistIE: try to extract the url of the entries from the media$group dictionary

Extracting it from content can return rtsp urls.
This commit is contained in:
Jaime Marquínez Ferrándiz 2013-06-14 14:14:02 +02:00
parent 038a3a1a61
commit 31eead52e7

View file

@ -1606,9 +1606,15 @@ class YoutubePlaylistIE(InfoExtractor):
# Number of videos is a multiple of self._MAX_RESULTS # Number of videos is a multiple of self._MAX_RESULTS
break break
videos += [ (entry['yt$position']['$t'], entry['content']['src']) for entry in response['feed']['entry']:
for entry in response['feed']['entry'] index = entry['yt$position']['$t']
if 'content' in entry ] if 'media$group' in entry and 'media$player' in entry['media$group']:
videos.append((index, entry['media$group']['media$player']['url']))
# Using this field can cause problems:
# https://github.com/rg3/youtube-dl/issues/886
elif 'content' in entry:
videos.append((index, entry['content']['src']))
if len(response['feed']['entry']) < self._MAX_RESULTS: if len(response['feed']['entry']) < self._MAX_RESULTS:
break break