diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index 464c8d690..4f0cdc5ea 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -929,6 +929,7 @@ from .revision3 import ( Revision3IE, ) from .rice import RICEIE +from .rightnowmedia import RightNowMediaIE from .rmcdecouverte import RMCDecouverteIE from .ro220 import Ro220IE from .rockstargames import RockstarGamesIE diff --git a/youtube_dl/extractor/rightnowmedia.py b/youtube_dl/extractor/rightnowmedia.py new file mode 100644 index 000000000..d43e38f8d --- /dev/null +++ b/youtube_dl/extractor/rightnowmedia.py @@ -0,0 +1,55 @@ +from __future__ import unicode_literals + +from .common import InfoExtractor +from ..utils import ( + determine_ext +) + +class RightNowMediaIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?rightnowmedia\.org/Content/(?:VideoElement|Series|KidsShow)/(?P[0-9]+)' + _TEST = { + 'url': 'https://www.rightnowmedia.org/Content/VideoElement/231113', + 'info_dict': { + 'id': '231113', + 'ext': 'mp4', + 'title': 'Augustana (S.D.) Baseball vs University of Mary', + 'description': 'md5:7578478614aae3bdd4a90f578f787438', + 'timestamp': 1490468400, + 'upload_date': '20170325', + } + } + + 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) + + video_url = 'https://%s' % video_info_dicts['downloadLinks'] + 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"], + 'preference': 10 if quality == 'high' else 0, + 'format_note': quality, + 'format_id': '%s-%s' % (quality, determine_ext(video_info["Link"])), + }) + self._sort_formats(formats) + + title = "Test 01" + description = "aaaa" + + return { + 'id': video_id, + 'title': title, + 'description': description, + 'formats': formats, + }