aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRemita Amine <remitamine@gmail.com>2016-09-08 22:53:44 +0100
committerRemita Amine <remitamine@gmail.com>2016-09-08 22:53:44 +0100
commit4d5726b0d7562aff975c91303b8ae8cfc4de8c51 (patch)
treeb18d770c67ea4a1d493fabcb15077d10db764026
parent4614ad7b591577793321b8e761510cf08ceb558b (diff)
[telequebec] Add new extractor(closes #1999)
-rw-r--r--youtube_dl/extractor/telequebec.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/youtube_dl/extractor/telequebec.py b/youtube_dl/extractor/telequebec.py
new file mode 100644
index 000000000..4043fcb92
--- /dev/null
+++ b/youtube_dl/extractor/telequebec.py
@@ -0,0 +1,36 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import int_or_none
+
+
+class TeleQuebecIE(InfoExtractor):
+ _VALID_URL = r'https?://zonevideo\.telequebec\.tv/media/(?P<id>\d+)'
+ _TEST = {
+ 'url': 'http://zonevideo.telequebec.tv/media/20984/le-couronnement-de-new-york/couronnement-de-new-york',
+ 'md5': 'fe95a0957e5707b1b01f5013e725c90f',
+ 'info_dict': {
+ 'id': '20984',
+ 'ext': 'mp4',
+ 'title': 'Le couronnement de New York',
+ 'description': 'md5:f5b3d27a689ec6c1486132b2d687d432',
+ 'upload_date': '20160220',
+ 'timestamp': 1455965438,
+ }
+ }
+
+ def _real_extract(self, url):
+ media_id = self._match_id(url)
+ media_data = self._download_json(
+ 'https://mnmedias.api.telequebec.tv/api/v2/media/' + media_id,
+ media_id)['media']
+ return {
+ '_type': 'url_transparent',
+ 'id': media_id,
+ 'url': 'limelight:media:' + media_data['streamInfo']['sourceId'],
+ 'title': media_data['title'],
+ 'description': media_data.get('descriptions', [{'text': None}])[0].get('text'),
+ 'duration': int_or_none(media_data.get('durationInMilliseconds'), 1000),
+ 'ie_key': 'LimelightMedia',
+ }