You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
810 B

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