From 93678422ef28b85e1318dc1d180b91ce45600bf5 Mon Sep 17 00:00:00 2001 From: Daniel Cassidy Date: Tue, 17 Dec 2019 07:44:00 +0000 Subject: [PATCH] Fix crash when downloading iPlayer playlists that are not divided into seasons. --- youtube_dl/extractor/bbc.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/bbc.py b/youtube_dl/extractor/bbc.py index bfe6db99d..51effeba3 100644 --- a/youtube_dl/extractor/bbc.py +++ b/youtube_dl/extractor/bbc.py @@ -1291,7 +1291,10 @@ class BBCCoUkIPlayerPlaylistIE(BBCCoUkPlaylistBaseIE): redux_state = self._redux_state(webpage, playlist_id) slices = redux_state.get('header', {}).get('availableSlices', []) - season_ids = list(map(lambda s: s.get('id'), slices)) + if slices: + season_ids = list(map(lambda s: s.get('id'), slices)) + else: + season_ids = [] for season in itertools.count(1): while True: