aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormakeworld <25111343+makeworld-the-better-one@users.noreply.github.com>2021-11-10 14:37:05 -0500
committerGitHub <noreply@github.com>2021-11-11 01:07:05 +0530
commit013ae2e5038178420966fa7e029908b37ecda821 (patch)
treefd9c25011bc86b26a5e90161bf4f206dabe8e78e
parentb47d236d724f7a129c7ed0792fb847eb12e6f8a5 (diff)
downloadhypervideo-pre-013ae2e5038178420966fa7e029908b37ecda821.tar.lz
hypervideo-pre-013ae2e5038178420966fa7e029908b37ecda821.tar.xz
hypervideo-pre-013ae2e5038178420966fa7e029908b37ecda821.zip
[CBC Gem] Fix for shows that don't have all seasons (#1621)
Closes #1594 Authored by: makeworld-the-better-one
-rw-r--r--yt_dlp/extractor/cbc.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/yt_dlp/extractor/cbc.py b/yt_dlp/extractor/cbc.py
index 4fcf2a9c1..413053499 100644
--- a/yt_dlp/extractor/cbc.py
+++ b/yt_dlp/extractor/cbc.py
@@ -390,7 +390,8 @@ class CBCGemPlaylistIE(InfoExtractor):
show = match.group('show')
show_info = self._download_json(self._API_BASE + show, season_id)
season = int(match.group('season'))
- season_info = try_get(show_info, lambda x: x['seasons'][season - 1])
+
+ season_info = next((s for s in show_info['seasons'] if s.get('season') == season), None)
if season_info is None:
raise ExtractorError(f'Couldn\'t find season {season} of {show}')