diff options
author | jo-nike <derter@gmail.com> | 2023-05-29 02:04:08 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-29 11:34:08 +0530 |
commit | 4afb208cf07b59291ae3b0c4efc83945ee5b8812 (patch) | |
tree | 7b866c25b97fddfccd5083dc30c30895cd31e5b1 | |
parent | 5c14b213679ed4401288bdc86ae696932e219222 (diff) | |
download | hypervideo-pre-4afb208cf07b59291ae3b0c4efc83945ee5b8812.tar.lz hypervideo-pre-4afb208cf07b59291ae3b0c4efc83945ee5b8812.tar.xz hypervideo-pre-4afb208cf07b59291ae3b0c4efc83945ee5b8812.zip |
[extractor/cbc] Ignore 426 from API (#6781)
Closes #6716
Authored by: jo-nike
-rw-r--r-- | yt_dlp/extractor/cbc.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/yt_dlp/extractor/cbc.py b/yt_dlp/extractor/cbc.py index e42f06246..41e092422 100644 --- a/yt_dlp/extractor/cbc.py +++ b/yt_dlp/extractor/cbc.py @@ -351,7 +351,9 @@ class CBCGemIE(InfoExtractor): def _real_extract(self, url): video_id = self._match_id(url) - video_info = self._download_json('https://services.radio-canada.ca/ott/cbc-api/v2/assets/' + video_id, video_id) + video_info = self._download_json( + f'https://services.radio-canada.ca/ott/cbc-api/v2/assets/{video_id}', + video_id, expected_status=426) email, password = self._get_login_info() if email and password: @@ -426,7 +428,7 @@ class CBCGemPlaylistIE(InfoExtractor): match = self._match_valid_url(url) season_id = match.group('id') show = match.group('show') - show_info = self._download_json(self._API_BASE + show, season_id) + show_info = self._download_json(self._API_BASE + show, season_id, expected_status=426) season = int(match.group('season')) season_info = next((s for s in show_info['seasons'] if s.get('season') == season), None) |