aboutsummaryrefslogtreecommitdiffstats
path: root/hypervideo_dl/extractor/tennistv.py
diff options
context:
space:
mode:
Diffstat (limited to 'hypervideo_dl/extractor/tennistv.py')
-rw-r--r--hypervideo_dl/extractor/tennistv.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/hypervideo_dl/extractor/tennistv.py b/hypervideo_dl/extractor/tennistv.py
index a586f30..a39a2fc 100644
--- a/hypervideo_dl/extractor/tennistv.py
+++ b/hypervideo_dl/extractor/tennistv.py
@@ -69,7 +69,7 @@ class TennisTVIE(InfoExtractor):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
- internal_id = self._search_regex(r'video=([0-9]+)', webpage, 'internal video id')
+ internal_id = self._search_regex(r'video=([\w-]+)', webpage, 'internal video id')
headers = {
'Origin': 'https://www.tennistv.com',
@@ -79,16 +79,18 @@ class TennisTVIE(InfoExtractor):
}
check_data = {
'videoID': internal_id,
- 'VideoUrlType': 'HLSV3',
+ 'VideoUrlType': 'HLS',
}
check_json = json.dumps(check_data).encode('utf-8')
check_result = self._download_json(
'https://www.tennistv.com/api/users/v1/entitlementchecknondiva',
video_id, note='Checking video authorization', headers=headers, data=check_json)
formats = self._extract_m3u8_formats(check_result['contentUrl'], video_id, ext='mp4')
+ self._sort_formats(formats)
- vdata_url = 'https://www.tennistv.com/api/channels/v1/de/none/video/%s' % video_id
- vdata = self._download_json(vdata_url, video_id)
+ vdata = self._download_json(
+ 'https://www.tennistv.com/api/en/v2/none/common/video/%s' % video_id,
+ video_id, headers=headers)
timestamp = unified_timestamp(vdata['timestamp'])
thumbnail = vdata['video']['thumbnailUrl']