Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[extractor/cbc] Workaround CBC returning a http 426 when querying file data #6781

Merged
merged 3 commits into from May 29, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions yt_dlp/extractor/cbc.py
Expand Up @@ -349,7 +349,8 @@ def _find_secret_formats(self, formats, video_id):

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('https://services.radio-canada.ca/ott/cbc-api/v2/assets/' + video_id, video_id,
expected_status=426)
pukkandan marked this conversation as resolved.
Show resolved Hide resolved

email, password = self._get_login_info()
if email and password:
Expand Down Expand Up @@ -421,7 +422,7 @@ def _real_extract(self, url):
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)
Expand Down