1
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-05-22 18:05:46 -05:00

Fix _real_extract

This commit is contained in:
Michaël De Boey 2025-03-08 10:57:44 +01:00
parent ab93699b6a
commit 6465be6c2f
No known key found for this signature in database

View file

@ -336,9 +336,10 @@ def _perform_login(self, username, password):
def _real_extract(self, url):
display_id = self._match_id(url)
refresh_token = self._fetch_refresh_token()
metadata = self._download_json(
f'https://www.vrt.be/vrtnu-api/graphql{"" if self._fetch_refresh_token() else "/public"}/v1',
f'https://www.vrt.be/vrtnu-api/graphql{"" if refresh_token else "/public"}/v1',
display_id, 'Downloading asset JSON', 'Unable to download asset JSON',
data=json.dumps({
'operationName': 'VideoPage',
@ -346,7 +347,8 @@ def _real_extract(self, url):
'variables': {'pageId': urllib.parse.urlparse(url).path},
}).encode(),
headers={
'content-type': 'application/json',
'Authorization': f'Bearer {refresh_token}' if refresh_token else None,
'Content-Type': 'application/json',
'x-vrt-client-name': 'WEB',
'x-vrt-client-version': '1.5.9',
'x-vrt-zone': 'default',