|
|
@ -600,6 +600,7 @@ class PBSIE(InfoExtractor):
|
|
|
|
|
|
|
|
|
|
|
|
formats = []
|
|
|
|
formats = []
|
|
|
|
http_url = None
|
|
|
|
http_url = None
|
|
|
|
|
|
|
|
hls_subs = {}
|
|
|
|
for num, redirect in enumerate(redirects):
|
|
|
|
for num, redirect in enumerate(redirects):
|
|
|
|
redirect_id = redirect.get('eeid')
|
|
|
|
redirect_id = redirect.get('eeid')
|
|
|
|
|
|
|
|
|
|
|
@ -622,8 +623,9 @@ class PBSIE(InfoExtractor):
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
|
|
|
|
|
|
|
|
if determine_ext(format_url) == 'm3u8':
|
|
|
|
if determine_ext(format_url) == 'm3u8':
|
|
|
|
formats.extend(self._extract_m3u8_formats(
|
|
|
|
hls_formats, hls_subs = self._extract_m3u8_formats_and_subtitles(
|
|
|
|
format_url, display_id, 'mp4', m3u8_id='hls', fatal=False))
|
|
|
|
format_url, display_id, 'mp4', m3u8_id='hls', fatal=False)
|
|
|
|
|
|
|
|
formats.extend(hls_formats)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
formats.append({
|
|
|
|
formats.append({
|
|
|
|
'url': format_url,
|
|
|
|
'url': format_url,
|
|
|
@ -666,25 +668,12 @@ class PBSIE(InfoExtractor):
|
|
|
|
age_limit = US_RATINGS.get(rating_str)
|
|
|
|
age_limit = US_RATINGS.get(rating_str)
|
|
|
|
|
|
|
|
|
|
|
|
subtitles = {}
|
|
|
|
subtitles = {}
|
|
|
|
closed_captions_url = info.get('closed_captions_url')
|
|
|
|
captions = info.get('cc') or {}
|
|
|
|
if closed_captions_url:
|
|
|
|
for caption_url in captions.values():
|
|
|
|
subtitles['en'] = [{
|
|
|
|
subtitles.setdefault('en', []).append({
|
|
|
|
'ext': 'ttml',
|
|
|
|
'url': caption_url
|
|
|
|
'url': closed_captions_url,
|
|
|
|
})
|
|
|
|
}]
|
|
|
|
subtitles = self._merge_subtitles(subtitles, hls_subs)
|
|
|
|
mobj = re.search(r'/(\d+)_Encoded\.dfxp', closed_captions_url)
|
|
|
|
|
|
|
|
if mobj:
|
|
|
|
|
|
|
|
ttml_caption_suffix, ttml_caption_id = mobj.group(0, 1)
|
|
|
|
|
|
|
|
ttml_caption_id = int(ttml_caption_id)
|
|
|
|
|
|
|
|
subtitles['en'].extend([{
|
|
|
|
|
|
|
|
'url': closed_captions_url.replace(
|
|
|
|
|
|
|
|
ttml_caption_suffix, '/%d_Encoded.srt' % (ttml_caption_id + 1)),
|
|
|
|
|
|
|
|
'ext': 'srt',
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
|
|
|
'url': closed_captions_url.replace(
|
|
|
|
|
|
|
|
ttml_caption_suffix, '/%d_Encoded.vtt' % (ttml_caption_id + 2)),
|
|
|
|
|
|
|
|
'ext': 'vtt',
|
|
|
|
|
|
|
|
}])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# info['title'] is often incomplete (e.g. 'Full Episode', 'Episode 5', etc)
|
|
|
|
# info['title'] is often incomplete (e.g. 'Full Episode', 'Episode 5', etc)
|
|
|
|
# Try turning it to 'program - title' naming scheme if possible
|
|
|
|
# Try turning it to 'program - title' naming scheme if possible
|
|
|
|