DiscoveryIE: make playlist extraction tolerate entries with blank 'src' values
There are alot here. I assume the videos are disabled. http://www.discovery.com/tv-shows/other-shows/videos/other-shows-when-we-left-earth-videos/ There is an 'embedurl' for all of the videos, however there is no support for the urls in question. (todo)
This commit is contained in:
parent
41c0d2f8cb
commit
d9dd8b5664
@ -41,8 +41,16 @@ class DiscoveryIE(InfoExtractor):
|
||||
info = self._download_json(url + '?flat=1', video_id)
|
||||
|
||||
video_title = info.get('playlist_title') or info.get('video_title')
|
||||
|
||||
entries = [{
|
||||
entries = []
|
||||
collected = {}
|
||||
for idx, video_info in enumerate(info['playlist']):
|
||||
if collected.get( video_info.get('id') ):
|
||||
continue
|
||||
collected[video_info.get('id')] = True
|
||||
if video_info['src'] == '':
|
||||
self.report_warning('video "%s" does not have a src url' % video_info.get('id','UNKNOWN'))
|
||||
continue
|
||||
entries.append({
|
||||
'id': compat_str(video_info['id']),
|
||||
'formats': self._extract_m3u8_formats(
|
||||
video_info['src'], video_id, ext='mp4',
|
||||
@ -54,6 +62,6 @@ class DiscoveryIE(InfoExtractor):
|
||||
'thumbnail': video_info.get('thumbnailURL'),
|
||||
'alt_title': video_info.get('secondary_title'),
|
||||
'timestamp': parse_iso8601(video_info.get('publishedDate')),
|
||||
} for idx, video_info in enumerate(info['playlist'])]
|
||||
})
|
||||
|
||||
return self.playlist_result(entries, video_id, video_title)
|
||||
|
Loading…
x
Reference in New Issue
Block a user