From c8d83a22ef9fdbc896312632f4995754a45b8fc2 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Wed, 24 Feb 2021 02:25:04 +0530 Subject: [PATCH] [tennistv] Fix extractor (Closes #104) --- youtube_dlc/extractor/tennistv.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/youtube_dlc/extractor/tennistv.py b/youtube_dlc/extractor/tennistv.py index a586f30ad..5e3eb8938 100644 --- a/youtube_dlc/extractor/tennistv.py +++ b/youtube_dlc/extractor/tennistv.py @@ -69,7 +69,7 @@ def _real_extract(self, url): 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,7 +79,7 @@ def _real_extract(self, url): } check_data = { 'videoID': internal_id, - 'VideoUrlType': 'HLSV3', + 'VideoUrlType': 'HLS', } check_json = json.dumps(check_data).encode('utf-8') check_result = self._download_json( @@ -87,8 +87,9 @@ def _real_extract(self, url): video_id, note='Checking video authorization', headers=headers, data=check_json) formats = self._extract_m3u8_formats(check_result['contentUrl'], video_id, ext='mp4') - 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']