[CBC Gem] Fix for shows that don't have all seasons (#1621)

Closes #1594
Authored by: makeworld-the-better-one
pull/1631/head
makeworld 3 years ago committed by GitHub
parent b47d236d72
commit 013ae2e503
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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}')

Loading…
Cancel
Save