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.

36 lines
1.1 KiB

  1. import re
  2. from .common import InfoExtractor
  3. class UstreamIE(InfoExtractor):
  4. _VALID_URL = r'https?://www\.ustream\.tv/recorded/(?P<videoID>\d+)'
  5. IE_NAME = u'ustream'
  6. def _real_extract(self, url):
  7. m = re.match(self._VALID_URL, url)
  8. video_id = m.group('videoID')
  9. video_url = u'http://tcdn.ustream.tv/video/%s' % video_id
  10. webpage = self._download_webpage(url, video_id)
  11. self.report_extraction(video_id)
  12. video_title = self._html_search_regex(r'data-title="(?P<title>.+)"',
  13. webpage, u'title')
  14. uploader = self._html_search_regex(r'data-content-type="channel".*?>(?P<uploader>.*?)</a>',
  15. webpage, u'uploader', fatal=False, flags=re.DOTALL)
  16. thumbnail = self._html_search_regex(r'<link rel="image_src" href="(?P<thumb>.*?)"',
  17. webpage, u'thumbnail', fatal=False)
  18. info = {
  19. 'id': video_id,
  20. 'url': video_url,
  21. 'ext': 'flv',
  22. 'title': video_title,
  23. 'uploader': uploader,
  24. 'thumbnail': thumbnail,
  25. }
  26. return info