]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/gputechconf.py
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
13 class GPUTechConfIE(InfoExtractor
):
14 _VALID_URL
= r
'https?://on-demand\.gputechconf\.com/gtc/2015/video/S(?P<id>\d+)\.html'
16 'url': 'http://on-demand.gputechconf.com/gtc/2015/video/S5156.html',
17 'md5': 'a8862a00a0fd65b8b43acc5b8e33f798',
21 'title': 'Coordinating More Than 3 Million CUDA Threads for Social Network Analysis',
26 def _real_extract(self
, url
):
27 video_id
= self
._match
_id
(url
)
28 webpage
= self
._download
_webpage
(url
, video_id
)
30 root_path
= self
._search
_regex
(r
'var\s+rootPath\s*=\s*"([^"]+)', webpage
, 'root path', 'http://evt.dispeak.com/nvidia/events/gtc15/')
31 xml_file_id
= self
._search
_regex
(r
'var\s+xmlFileId\s*=\s*"([^"]+)', webpage
, 'xml file id')
33 doc
= self
._download
_xml
('%sxml/%s.xml' % (root_path
, xml_file_id
), video_id
)
35 metadata
= xpath_element(doc
, 'metadata')
36 http_host
= xpath_text(metadata
, 'httpHost', 'http host', True)
37 mbr_videos
= xpath_element(metadata
, 'MBRVideos')
40 for mbr_video
in mbr_videos
.findall('MBRVideo'):
41 stream_name
= xpath_text(mbr_video
, 'streamName')
44 'url': 'http://%s/%s' % (http_host
, stream_name
.replace('mp4:', '')),
45 'tbr': int_or_none(xpath_text(mbr_video
, 'bitrate')),
47 self
._sort
_formats
(formats
)
51 'title': xpath_text(metadata
, 'title'),
52 'duration': parse_duration(xpath_text(metadata
, 'endTime')),
53 'creator': xpath_text(metadata
, 'speaker'),