about summary refs log tree commit diff
path: root/youtube_dl/extractor/cspan.py
diff options
context:
space:
mode:
authorYen Chi Hsuan <yan12125@gmail.com>2017-01-20 22:11:43 +0800
committerYen Chi Hsuan <yan12125@gmail.com>2017-01-20 22:27:13 +0800
commit4447fb23320b9214ab3188717794d00b18887617 (patch)
tree40a76efa939c9f02ba7df40af514462ecafa9a3b /youtube_dl/extractor/cspan.py
parentd77ac737900eede5e1508b9822e71c8595fe0879 (diff)
downloadyoutube-dl-4447fb23320b9214ab3188717794d00b18887617.tar.gz
youtube-dl-4447fb23320b9214ab3188717794d00b18887617.tar.xz
youtube-dl-4447fb23320b9214ab3188717794d00b18887617.zip
[cspan] Support Ustream embedded videos
Closes #11547
Diffstat (limited to 'youtube_dl/extractor/cspan.py')
-rw-r--r--youtube_dl/extractor/cspan.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/youtube_dl/extractor/cspan.py b/youtube_dl/extractor/cspan.py
index 7e5d4f227..92a827a4b 100644
--- a/youtube_dl/extractor/cspan.py
+++ b/youtube_dl/extractor/cspan.py
@@ -12,6 +12,7 @@ from ..utils import (
     ExtractorError,
 )
 from .senateisvp import SenateISVPIE
+from .ustream import UstreamIE
 
 
 class CSpanIE(InfoExtractor):
@@ -57,12 +58,30 @@ class CSpanIE(InfoExtractor):
         'params': {
             'skip_download': True,  # m3u8 downloads
         }
+    }, {
+        # Ustream embedded video
+        'url': 'https://www.c-span.org/video/?114917-1/armed-services',
+        'info_dict': {
+            'id': '58428542',
+            'ext': 'flv',
+            'title': 'USHR07 Armed Services Committee',
+            'description': 'hsas00-2118-20150204-1000et-07\n\n\nUSHR07 Armed Services Committee',
+            'timestamp': 1423060374,
+            'upload_date': '20150204',
+            'uploader': 'HouseCommittee',
+            'uploader_id': '12987475',
+        },
     }]
 
     def _real_extract(self, url):
         video_id = self._match_id(url)
         video_type = None
         webpage = self._download_webpage(url, video_id)
+
+        ustream_url = UstreamIE._extract_url(webpage)
+        if ustream_url:
+            return self.url_result(ustream_url, UstreamIE.ie_key())
+
         # We first look for clipid, because clipprog always appears before
         patterns = [r'id=\'clip(%s)\'\s*value=\'([0-9]+)\'' % t for t in ('id', 'prog')]
         results = list(filter(None, (re.search(p, webpage) for p in patterns)))