From d76916f79ec2d340dfe0c293bb7d223ad673dc43 Mon Sep 17 00:00:00 2001 From: Andy Bottom Date: Sun, 21 Oct 2018 14:09:30 -0500 Subject: [PATCH] Fixed formatting according to flake8 --- youtube_dl/extractor/rightnowmedia.py | 28 +++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/youtube_dl/extractor/rightnowmedia.py b/youtube_dl/extractor/rightnowmedia.py index e7bc2fbb7..ea8f18686 100644 --- a/youtube_dl/extractor/rightnowmedia.py +++ b/youtube_dl/extractor/rightnowmedia.py @@ -6,6 +6,7 @@ from ..utils import ( determine_ext, ) + class RightNowMediaIE(InfoExtractor): IE_NAME = 'rightnowmedia' _VALID_URL = r'https?://(?:www\.)?rightnowmedia\.org/Content/(?P[0-9]+)/(?:downloadAndEmbed)' @@ -21,16 +22,15 @@ class RightNowMediaIE(InfoExtractor): def _real_extract(self, url): # Video Id video_id = self._match_id(url) - + # Download video_info_dicts = self._download_json( 'https://www.rightnowmedia.org/Content/%s/downloadAndEmbed' % video_id, video_id) - + # Get All The Formats formats = [] for video_info in video_info_dicts['downloadLinks']: - video_url = video_info.get('src') quality = 'high' if 'HD 1080p' in video_info["QualityName"] else 'low' formats.append({ 'url': video_info["Link"], @@ -38,15 +38,15 @@ class RightNowMediaIE(InfoExtractor): 'format_note': quality, 'format_id': '%s-%s' % (quality, determine_ext(video_info["Link"])), }) - + # Get the Title title = compat_urllib_parse_unquote(re.findall( - r'.*?filename=(.*).*(?:.mp4)', - formats[0]['url'])[0]) - + r'.*?filename=(.*).*(?:.mp4)', + formats[0]['url'])[0]) + # Sort Formats self._sort_formats(formats) - + # Return return { 'id': video_id, @@ -54,7 +54,7 @@ class RightNowMediaIE(InfoExtractor): 'formats': formats, } - + class RightNowMediaPlaylistIE(InfoExtractor): IE_NAME = 'rightnowmedia:playlist' _VALID_URL = r'https?://(?:www\.)?rightnowmedia\.org/Content/(?:Series|KidsShow)/(?P[0-9]+)' @@ -64,7 +64,7 @@ class RightNowMediaPlaylistIE(InfoExtractor): 'id': '265320' }, 'playlist_count': 9, - },{ + }, { 'url': 'https://www.rightnowmedia.org/Content/KidsShow/298875', 'info_dict': { 'id': '298875' @@ -77,18 +77,18 @@ class RightNowMediaPlaylistIE(InfoExtractor): playlist_id = self._match_id(url) # Download Webpage - webpage = self._download_webpage(url, playlist_id) - + webpage = self._download_webpage(url, playlist_id) + # Find The Correct Table all_buckets = re.findall( r'(?s)', webpage) - + # Find All The Video Elements all_video_elements = re.findall( r'.*?data-detail-content-id="(.*)">.*', all_buckets[0]) - + # Finalize All The URLs entries = [] for video_element in all_video_elements: