1
0
mirror of https://github.com/l1ving/youtube-dl synced 2020-11-18 19:53:54 -08:00

Initial commit for rightnowmedia.

This commit is contained in:
Andy Bottom 2018-10-18 22:23:23 -05:00
parent 5d90a8a5f3
commit f65e62f00e
2 changed files with 56 additions and 0 deletions

View File

@ -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

View File

@ -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<id>[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,
}