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.

35 lines
1.2 KiB

  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. from .common import InfoExtractor
  4. class GPUTechConfIE(InfoExtractor):
  5. _VALID_URL = r'https?://on-demand\.gputechconf\.com/gtc/2015/video/S(?P<id>\d+)\.html'
  6. _TEST = {
  7. 'url': 'http://on-demand.gputechconf.com/gtc/2015/video/S5156.html',
  8. 'md5': 'a8862a00a0fd65b8b43acc5b8e33f798',
  9. 'info_dict': {
  10. 'id': '5156',
  11. 'ext': 'mp4',
  12. 'title': 'Coordinating More Than 3 Million CUDA Threads for Social Network Analysis',
  13. 'duration': 1219,
  14. }
  15. }
  16. def _real_extract(self, url):
  17. video_id = self._match_id(url)
  18. webpage = self._download_webpage(url, video_id)
  19. root_path = self._search_regex(
  20. r'var\s+rootPath\s*=\s*"([^"]+)', webpage, 'root path',
  21. default='http://evt.dispeak.com/nvidia/events/gtc15/')
  22. xml_file_id = self._search_regex(
  23. r'var\s+xmlFileId\s*=\s*"([^"]+)', webpage, 'xml file id')
  24. return {
  25. '_type': 'url_transparent',
  26. 'id': video_id,
  27. 'url': '%sxml/%s.xml' % (root_path, xml_file_id),
  28. 'ie_key': 'DigitallySpeaking',
  29. }