]> git.bitcoin.ninja Git - youtube-dl/blob - slashdot.py
2cba530766a2b898967aefe1c3f7761ebe986d45
[youtube-dl] / slashdot.py
1 import re
2
3 from .common import InfoExtractor
4
5
6 class SlashdotIE(InfoExtractor):
7     _VALID_URL = r'https?://tv.slashdot.org/video/\?embed=(?P<id>.*?)(&|$)'
8
9     _TEST = {
10         u'url': u'http://tv.slashdot.org/video/?embed=JscHMzZDplD0p-yNLOzTfzC3Q3xzJaUz',
11         u'file': u'JscHMzZDplD0p-yNLOzTfzC3Q3xzJaUz.mp4',
12         u'md5': u'd2222e7a4a4c1541b3e0cf732fb26735',
13         u'info_dict': {
14             u'title': u' Meet the Stampede Supercomputing Cluster\'s Administrator',
15         },
16     }
17
18     def _real_extract(self, url):
19         mobj = re.match(self._VALID_URL, url)
20         video_id = mobj.group('id')
21         webpage = self._download_webpage(url, video_id)
22         ooyala_url = self._search_regex(r'<script src="(.*?)"', webpage, 'ooyala url')
23         return self.url_result(ooyala_url, 'Ooyala')