mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-12-23 08:26:50 +00:00
[prosiebensat1] Fix playlist support (Closes #10745)
This commit is contained in:
parent
63c583eb2c
commit
ddde91952f
@ -310,6 +310,10 @@ class ProSiebenSat1IE(ProSiebenSat1BaseIE):
|
|||||||
'url': 'http://www.sat1gold.de/tv/edel-starck/video/11-staffel-1-episode-1-partner-wider-willen-ganze-folge',
|
'url': 'http://www.sat1gold.de/tv/edel-starck/video/11-staffel-1-episode-1-partner-wider-willen-ganze-folge',
|
||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'url': 'http://www.sat1gold.de/tv/edel-starck/playlist/die-gesamte-1-staffel',
|
||||||
|
'only_matching': True,
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
_TOKEN = 'prosieben'
|
_TOKEN = 'prosieben'
|
||||||
@ -381,19 +385,28 @@ class ProSiebenSat1IE(ProSiebenSat1BaseIE):
|
|||||||
def _extract_playlist(self, url, webpage):
|
def _extract_playlist(self, url, webpage):
|
||||||
playlist_id = self._html_search_regex(
|
playlist_id = self._html_search_regex(
|
||||||
self._PLAYLIST_ID_REGEXES, webpage, 'playlist id')
|
self._PLAYLIST_ID_REGEXES, webpage, 'playlist id')
|
||||||
for regex in self._PLAYLIST_CLIP_REGEXES:
|
playlist = self._parse_json(
|
||||||
playlist_clips = re.findall(regex, webpage)
|
self._search_regex(
|
||||||
if playlist_clips:
|
'var\s+contentResources\s*=\s*(\[.+?\]);\s*</script',
|
||||||
title = self._html_search_regex(
|
webpage, 'playlist'),
|
||||||
self._TITLE_REGEXES, webpage, 'title')
|
playlist_id)
|
||||||
description = self._html_search_regex(
|
entries = []
|
||||||
self._DESCRIPTION_REGEXES, webpage, 'description', fatal=False)
|
for item in playlist:
|
||||||
entries = [
|
clip_id = item.get('id') or item.get('upc')
|
||||||
self.url_result(
|
if not clip_id:
|
||||||
re.match('(.+?//.+?)/', url).group(1) + clip_path,
|
continue
|
||||||
'ProSiebenSat1')
|
info = self._extract_video_info(url, clip_id)
|
||||||
for clip_path in playlist_clips]
|
info.update({
|
||||||
return self.playlist_result(entries, playlist_id, title, description)
|
'id': clip_id,
|
||||||
|
'title': item.get('title') or item.get('teaser', {}).get('headline'),
|
||||||
|
'description': item.get('teaser', {}).get('description'),
|
||||||
|
'thumbnail': item.get('poster'),
|
||||||
|
'duration': float_or_none(item.get('duration')),
|
||||||
|
'series': item.get('tvShowTitle'),
|
||||||
|
'uploader': item.get('broadcastPublisher'),
|
||||||
|
})
|
||||||
|
entries.append(info)
|
||||||
|
return self.playlist_result(entries, playlist_id)
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
|
Loading…
Reference in New Issue
Block a user