mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-09-22 02:11:26 +02:00
Compare commits
No commits in common. "bf4fce8cbd9dc6d9964769b358a979ce509a3654" and "f3f5d080bdff666c535f39e4ab0a1fea9095d5bd" have entirely different histories.
bf4fce8cbd
...
f3f5d080bd
|
@ -31,7 +31,6 @@ class LaXarxaMesIE(InfoExtractor):
|
|||
def _perform_login(self, username, password):
|
||||
if self._TOKEN:
|
||||
return
|
||||
|
||||
login = self._download_json(
|
||||
'https://api.laxarxames.cat/Authorization/SignIn', None, note='Logging in', headers={
|
||||
'X-Tenantorigin': 'https://laxarxames.cat',
|
||||
|
@ -43,23 +42,23 @@ class LaXarxaMesIE(InfoExtractor):
|
|||
'PlatformCode': 'WEB',
|
||||
'Name': 'Mac OS ()',
|
||||
},
|
||||
}).encode(), expected_status=401)
|
||||
}).encode('utf-8'), expected_status=401)
|
||||
|
||||
self._TOKEN = traverse_obj(login, ('AuthorizationToken', 'Token', {str}))
|
||||
if not self._TOKEN:
|
||||
if not traverse_obj(login, ('AuthorizationToken', 'Token', {str})):
|
||||
raise ExtractorError('Login failed', expected=True)
|
||||
self._TOKEN = login['AuthorizationToken']['Token']
|
||||
|
||||
def _real_extract(self, url):
|
||||
video_id = self._match_id(url)
|
||||
|
||||
if not self._TOKEN:
|
||||
self.raise_login_required()
|
||||
|
||||
media_play_info = self._download_json(
|
||||
'https://api.laxarxames.cat/Media/GetMediaPlayInfo', video_id,
|
||||
data=json.dumps({
|
||||
'MediaId': int(video_id),
|
||||
'StreamType': 'MAIN'
|
||||
}).encode(), headers={
|
||||
}).encode('utf-8'), headers={
|
||||
'Authorization': f'Bearer {self._TOKEN}',
|
||||
'X-Tenantorigin': 'https://laxarxames.cat',
|
||||
'Content-Type': 'application/json',
|
||||
|
@ -67,7 +66,6 @@ class LaXarxaMesIE(InfoExtractor):
|
|||
|
||||
if not traverse_obj(media_play_info, ('ContentUrl', {str})):
|
||||
self.raise_no_formats('No video found', expected=True)
|
||||
|
||||
return self.url_result(
|
||||
f'https://players.brightcove.net/5779379807001/default_default/index.html?videoId={media_play_info["ContentUrl"]}',
|
||||
BrightcoveNewIE, video_id, media_play_info.get('Title'))
|
||||
|
|
Loading…
Reference in New Issue
Block a user