summary refs log tree commit diff
diff options
context:
space:
mode:
authorPatrick Dessalle <patrick@dessalle.be>2019-08-28 19:04:57 +0200
committerSergey M․ <dstftw@gmail.com>2020-09-19 07:52:57 +0700
commitb856b3997ce2978f7a8c386b4ce4840fd221c45a (patch)
tree8c27eff07910de127d90cfa78a56f7bd19dd9fb2
parentcd85a1bb8b24eaf6a421a32a985d4c3ad4f80597 (diff)
downloadyoutube-dl-b856b3997ce2978f7a8c386b4ce4840fd221c45a.tar.gz
youtube-dl-b856b3997ce2978f7a8c386b4ce4840fd221c45a.tar.xz
youtube-dl-b856b3997ce2978f7a8c386b4ce4840fd221c45a.zip
[telequebec] Add support for brightcove videos (closes #25833)
-rw-r--r--youtube_dl/extractor/telequebec.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/youtube_dl/extractor/telequebec.py b/youtube_dl/extractor/telequebec.py
index c82c94b3a..3adea7bc5 100644
--- a/youtube_dl/extractor/telequebec.py
+++ b/youtube_dl/extractor/telequebec.py
@@ -12,6 +12,8 @@ from ..utils import (
 
 
 class TeleQuebecBaseIE(InfoExtractor):
+    BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/6150020952001/default_default/index.html?videoId=%s'
+
     @staticmethod
     def _limelight_result(media_id):
         return {
@@ -21,6 +23,13 @@ class TeleQuebecBaseIE(InfoExtractor):
             'ie_key': 'LimelightMedia',
         }
 
+    def _brightcove_result(self, brightcove_id):
+        return self.url_result(
+            smuggle_url(
+                self.BRIGHTCOVE_URL_TEMPLATE % brightcove_id,
+                {'geo_countries': ['CA']}),
+            'BrightcoveNew', brightcove_id)
+
 
 class TeleQuebecIE(TeleQuebecBaseIE):
     _VALID_URL = r'''(?x)
@@ -37,7 +46,7 @@ class TeleQuebecIE(TeleQuebecBaseIE):
             'id': '577116881b4b439084e6b1cf4ef8b1b3',
             'ext': 'mp4',
             'title': 'Un petit choc et puis repart!',
-            'description': 'md5:b04a7e6b3f74e32d7b294cffe8658374',
+            'description': 'md5:067bc84bd6afecad85e69d1000730907',
         },
         'params': {
             'skip_download': True,
@@ -58,7 +67,10 @@ class TeleQuebecIE(TeleQuebecBaseIE):
             'https://mnmedias.api.telequebec.tv/api/v2/media/' + media_id,
             media_id)['media']
 
-        info = self._limelight_result(media_data['streamInfo']['sourceId'])
+        if media_data['streamInfo']['source'] == 'Brightcove':
+            info = self._brightcove_result(media_data['streamInfo']['sourceId'])
+        elif media_data['streamInfo']['source'] == 'Limelight':
+            info = self._limelight_result(media_data['streamInfo']['sourceId'])
         info.update({
             'title': media_data.get('title'),
             'description': try_get(