1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-02-03 13:42:57 +08:00

Noovo Add new extractor

This commit is contained in:
Frederic Bournival 2017-04-25 22:02:04 -04:00
parent 8c0d3a4792
commit c1612e2382

View File

@ -4,9 +4,9 @@ from .common import InfoExtractor
class NoovoIE(InfoExtractor):
_VALID_URL = r'https?://(?:[a-z0-9\-]+\.)?noovo\.ca/videos/(?P<id>[a-z0-9\-]+/[a-z0-9\-]+)'
IE_NAME = 'Noovo'
IE_DESC = 'VTele, Max, MusiquePlus'
_VALID_URL = r'https?://(?:[a-z0-9-]+\.)?noovo\.ca/videos/(?P<id>[a-z0-9-]+/[a-z0-9-]+)'
_TESTS = [{
'url': 'http://noovo.ca/videos/rpm-plus/chrysler-imperial',
'md5': '2fcc04d0a8f4a853fad91233c2fdd121',
@ -19,18 +19,6 @@ class NoovoIE(InfoExtractor):
'upload_date': '20170405',
'uploader_id': '618566855001'
}
}, {
'url': 'http://interventions.noovo.ca/911/video/intoxication-aux-drogues-dures/?autoplay=1',
'md5': '0ca96cef6d6b3a3a4836a05936964da4',
'info_dict': {
'id': '5397570276001',
'description': 'md5:573bb7da6ffbfa310e2ebab88688e5ad',
'ext': 'mp4',
'timestamp': 1492112546,
'title': 'md5:5015fe58f797e58abdda1c6711530405',
'upload_date': '20170413',
'uploader_id': '618566855001'
}
}, {
'url': 'http://noovo.ca/videos/l-amour-est-dans-le-pre/episode-13-8',
'md5': '1199e96fbb93f2d42717115f72097b6b',
@ -43,21 +31,19 @@ class NoovoIE(InfoExtractor):
'upload_date': '20170412',
'uploader_id': '618566855001'
}
}, {
'url': 'http://interventions.noovo.ca/911/video/intoxication-aux-drogues-dures/?autoplay=1',
'only_matching': True
}]
TEMPLATE_API_URL = 'http://api.noovo.ca/api/v1/pages/single-episode/%s'
API_URL_TEMPLATE = 'http://api.noovo.ca/api/v1/pages/single-episode/%s'
BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/618566855001/default_default/index.html?videoId=%s'
def _real_extract(self, url):
video_id = self._match_id(url)
api_url = self.TEMPLATE_API_URL % video_id
api_url = self.API_URL_TEMPLATE % video_id
api_content = self._download_json(api_url, video_id)
brightcove_id = api_content.get('data').get('brightcoveId')
if not brightcove_id:
brightcove_id = api_content.get('data').get('contents')[0].get('brightcoveId')