mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-11-22 16:44:32 +01:00
Fixed formatting according to flake8
This commit is contained in:
parent
2d68da7781
commit
d76916f79e
@ -6,6 +6,7 @@ from ..utils import (
|
||||
determine_ext,
|
||||
)
|
||||
|
||||
|
||||
class RightNowMediaIE(InfoExtractor):
|
||||
IE_NAME = 'rightnowmedia'
|
||||
_VALID_URL = r'https?://(?:www\.)?rightnowmedia\.org/Content/(?P<id>[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<id>[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)<table [^"]*"..*? id="primarySeriesTable" [^"]*"..*? \B.*\B<div class="row rowStripMargin nomobile">',
|
||||
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:
|
||||
|
Loading…
Reference in New Issue
Block a user