]> jfr.im git - yt-dlp.git/commitdiff
[ie/cbc] Ignore any 426 from API (#7689)
authormakeworld <redacted>
Sat, 16 Sep 2023 20:49:43 +0000 (16:49 -0400)
committerGitHub <redacted>
Sat, 16 Sep 2023 20:49:43 +0000 (20:49 +0000)
Closes #7477
Authored by: makew0rld

yt_dlp/extractor/cbc.py

index b3c5471f7b7eecfad17d26924b2375b8f189f7ac..2920b9027d8ef416387467f8f702cec88441b83b 100644 (file)
@@ -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):