]> Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/slashdot.py
Prepare for upload.
[youtubedl] / youtube_dl / extractor / 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'add_ie': ['Ooyala'],
11 u'url': u'http://tv.slashdot.org/video/?embed=JscHMzZDplD0p-yNLOzTfzC3Q3xzJaUz',
12 u'file': u'JscHMzZDplD0p-yNLOzTfzC3Q3xzJaUz.mp4',
13 u'md5': u'd2222e7a4a4c1541b3e0cf732fb26735',
14 u'info_dict': {
15 u'title': u' Meet the Stampede Supercomputing Cluster\'s Administrator',
16 },
17 }
18
19 def _real_extract(self, url):
20 mobj = re.match(self._VALID_URL, url)
21 video_id = mobj.group('id')
22 webpage = self._download_webpage(url, video_id)
23 ooyala_url = self._search_regex(r'<script src="(.*?)"', webpage, 'ooyala url')
24 return self.url_result(ooyala_url, 'Ooyala')