Compare commits

...

4 Commits

Author SHA1 Message Date
HobbyistDev
6bdea3af54
Merge 1b9c25cc42 into eb15fd5a32 2024-11-17 21:33:20 +05:30
pukkandan
1b9c25cc42
Merge remote-tracking branch 'origin/master' into pr/4585 2022-10-19 12:47:38 +05:30
HobbyistDev
a006a37dd3 [TVIplayer] change self.wms_auth_sign_token to TVIPlayer._TOKEN 2022-08-07 08:20:05 +09:00
HobbyistDev
62140b56e5 [tviplayer] Improve _VALID_URL regex, add more test 2022-08-07 08:12:23 +09:00

View File

@ -51,11 +51,13 @@ class TVIPlayerIE(InfoExtractor):
'season_number': 1, 'season_number': 1,
}, },
}] }]
_TOKEN = None
def _real_initialize(self): def _real_initialize(self):
self.wms_auth_sign_token = self._download_webpage( if TVIPlayerIE._TOKEN is None:
'https://services.iol.pt/matrix?userId=', 'wmsAuthSign', TVIPlayerIE._TOKEN = self._download_webpage(
note='Trying to get wmsAuthSign token') 'https://services.iol.pt/matrix?userId=', 'wmsAuthSign',
note='Trying to get wmsAuthSign token')
def _real_extract(self, url): def _real_extract(self, url):
video_id = self._match_id(url) video_id = self._match_id(url)
@ -65,7 +67,7 @@ class TVIPlayerIE(InfoExtractor):
r'<script>\s*jsonData\s*=', webpage, 'json_data', video_id) r'<script>\s*jsonData\s*=', webpage, 'json_data', video_id)
formats, subtitles = self._extract_m3u8_formats_and_subtitles( formats, subtitles = self._extract_m3u8_formats_and_subtitles(
f'{json_data["videoUrl"]}?wmsAuthSign={self.wms_auth_sign_token}', f'{json_data["videoUrl"]}?wmsAuthSign={TVIPlayerIE._TOKEN}',
video_id, ext='mp4') video_id, ext='mp4')
return { return {
'id': video_id, 'id': video_id,