Skip to content

Commit

Permalink
[ie/cbc] Ignore any 426 from API (#7689)
Browse files Browse the repository at this point in the history
Closes #7477
Authored by: makew0rld
  • Loading branch information
makew0rld committed Sep 16, 2023
1 parent cebbd33 commit 9bf14be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions yt_dlp/extractor/cbc.py
Expand Up @@ -339,12 +339,12 @@ def _new_claims_token(self, email, password):
data = json.dumps({'jwt': sig}).encode()
headers = {'content-type': 'application/json', 'ott-device-type': 'web'}
resp = self._download_json('https://services.radio-canada.ca/ott/cbc-api/v2/token',
None, data=data, headers=headers)
None, data=data, headers=headers, expected_status=426)
cbc_access_token = resp['accessToken']

headers = {'content-type': 'application/json', 'ott-device-type': 'web', 'ott-access-token': cbc_access_token}
resp = self._download_json('https://services.radio-canada.ca/ott/cbc-api/v2/profile',
None, headers=headers)
None, headers=headers, expected_status=426)
return resp['claimsToken']

def _get_claims_token_expiry(self):
Expand Down

0 comments on commit 9bf14be

Please sign in to comment.