mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-10 09:07:58 +01:00
[extractor/cbc] Ignore 426 from API (#6781)
Closes #6716 Authored by: jo-nike
This commit is contained in:
parent
5c14b21367
commit
4afb208cf0
1 changed files with 4 additions and 2 deletions
|
@ -351,7 +351,9 @@ def _find_secret_formats(self, formats, video_id):
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(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()
|
email, password = self._get_login_info()
|
||||||
if email and password:
|
if email and password:
|
||||||
|
@ -426,7 +428,7 @@ def _real_extract(self, url):
|
||||||
match = self._match_valid_url(url)
|
match = self._match_valid_url(url)
|
||||||
season_id = match.group('id')
|
season_id = match.group('id')
|
||||||
show = match.group('show')
|
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 = int(match.group('season'))
|
||||||
|
|
||||||
season_info = next((s for s in show_info['seasons'] if s.get('season') == season), None)
|
season_info = next((s for s in show_info['seasons'] if s.get('season') == season), None)
|
||||||
|
|
Loading…
Reference in a new issue