1
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-03-09 12:50:23 -05:00
This commit is contained in:
HobbyistDev 2025-03-09 23:05:55 +05:30 committed by GitHub
commit 134dfedf21
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -51,9 +51,11 @@ 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:
TVIPlayerIE._TOKEN = self._download_webpage(
'https://services.iol.pt/matrix?userId=', 'wmsAuthSign', 'https://services.iol.pt/matrix?userId=', 'wmsAuthSign',
note='Trying to get wmsAuthSign token') note='Trying to get wmsAuthSign token')
@ -65,7 +67,7 @@ def _real_extract(self, url):
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,