aboutsummaryrefslogtreecommitdiffstats
path: root/hypervideo_dl/extractor/wat.py
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2021-10-18 15:24:21 -0500
committerJesús <heckyel@hyperbola.info>2021-10-18 15:24:21 -0500
commit5122028a4bcac4ae577ef7fbd55ccad5cb34ef5e (patch)
tree65209bc739db35e31f1c9b5b868eb5df4fe12ae3 /hypervideo_dl/extractor/wat.py
parent27fe903c511691c078942bef5ee9a05a43b15c8f (diff)
downloadhypervideo-5122028a4bcac4ae577ef7fbd55ccad5cb34ef5e.tar.lz
hypervideo-5122028a4bcac4ae577ef7fbd55ccad5cb34ef5e.tar.xz
hypervideo-5122028a4bcac4ae577ef7fbd55ccad5cb34ef5e.zip
update from upstream
Diffstat (limited to 'hypervideo_dl/extractor/wat.py')
-rw-r--r--hypervideo_dl/extractor/wat.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/hypervideo_dl/extractor/wat.py b/hypervideo_dl/extractor/wat.py
index f1bccc2..9ff4523 100644
--- a/hypervideo_dl/extractor/wat.py
+++ b/hypervideo_dl/extractor/wat.py
@@ -69,25 +69,30 @@ class WatIE(InfoExtractor):
title = video_info['title']
formats = []
+ subtitles = {}
def extract_formats(manifest_urls):
for f, f_url in manifest_urls.items():
if not f_url:
continue
if f in ('dash', 'mpd'):
- formats.extend(self._extract_mpd_formats(
+ fmts, subs = self._extract_mpd_formats_and_subtitles(
f_url.replace('://das-q1.tf1.fr/', '://das-q1-ssl.tf1.fr/'),
- video_id, mpd_id='dash', fatal=False))
+ video_id, mpd_id='dash', fatal=False)
elif f == 'hls':
- formats.extend(self._extract_m3u8_formats(
+ fmts, subs = self._extract_m3u8_formats_and_subtitles(
f_url, video_id, 'mp4',
- 'm3u8_native', m3u8_id='hls', fatal=False))
+ 'm3u8_native', m3u8_id='hls', fatal=False)
+ else:
+ continue
+ formats.extend(fmts)
+ self._merge_subtitles(subs, target=subtitles)
delivery = video_data.get('delivery') or {}
extract_formats({delivery.get('format'): delivery.get('url')})
if not formats:
if delivery.get('drm'):
- raise ExtractorError('This video is DRM protected.', expected=True)
+ self.report_drm(video_id)
manifest_urls = self._download_json(
'http://www.wat.tv/get/webhtml/' + video_id, video_id, fatal=False)
if manifest_urls:
@@ -103,4 +108,5 @@ class WatIE(InfoExtractor):
video_data, lambda x: x['mediametrie']['chapters'][0]['estatS4'])),
'duration': int_or_none(video_info.get('duration')),
'formats': formats,
+ 'subtitles': subtitles,
}