From b59130e3971546d9572b7503d84869fc959f1fae Mon Sep 17 00:00:00 2001 From: ddmgy Date: Tue, 12 Jun 2018 19:35:42 -0400 Subject: [PATCH] Change accessors for mandatory attributes. --- youtube_dl/extractor/roosterteeth.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/youtube_dl/extractor/roosterteeth.py b/youtube_dl/extractor/roosterteeth.py index bbe5d8c47..d669ee932 100644 --- a/youtube_dl/extractor/roosterteeth.py +++ b/youtube_dl/extractor/roosterteeth.py @@ -97,13 +97,11 @@ class RoosterTeethIE(InfoExtractor): headers=headers, ) - if len(api_response.get('data', [])) == 0: - raise ExtractorError('Unable to download video information') - data = api_response.get('data')[0] + data = api_response['data'][0] - attributes = data.get('attributes', {}) + attributes = data['attributes'] episode = attributes.get('display_title') - title = attributes.get('title') + title = attributes['title'] description = attributes.get('caption') series = attributes.get('show_title') @@ -139,8 +137,6 @@ class RoosterTeethIE(InfoExtractor): else: raise ExtractorError('Video is not available') - if len(video_response.get('data', [])) == 0: - raise ExtractorError('Unable to download video information') video_attributes = video_response.get('data')[0].get('attributes') m3u8_url = video_attributes.get('url')