gputechconf.py 1.1 KB

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