1 from __future__ import unicode_literals
5 from .common import InfoExtractor
7 get_element_by_attribute,
12 class TechTalksIE(InfoExtractor):
13 _VALID_URL = r'https?://techtalks\.tv/talks/(?:[^/]+/)?(?P<id>\d+)'
16 'url': 'http://techtalks.tv/talks/learning-topic-models-going-beyond-svd/57758/',
19 'title': 'Learning Topic Models --- Going beyond SVD',
26 'title': 'Learning Topic Models --- Going beyond SVD',
33 'title': 'Learning Topic Models --- Going beyond SVD',
39 'skip_download': True,
42 'url': 'http://techtalks.tv/talks/57758',
43 'only_matching': True,
46 def _real_extract(self, url):
47 mobj = re.match(self._VALID_URL, url)
48 talk_id = mobj.group('id')
49 webpage = self._download_webpage(url, talk_id)
50 rtmp_url = self._search_regex(
51 r'netConnectionUrl: \'(.*?)\'', webpage, 'rtmp url')
52 play_path = self._search_regex(
53 r'href=\'(.*?)\' [^>]*id="flowplayer_presenter"',
54 webpage, 'presenter play path')
55 title = clean_html(get_element_by_attribute('class', 'title', webpage))
60 'play_path': play_path,
63 m_slides = re.search(r'<a class="slides" href=\'(.*?)\'', webpage)
75 'id': talk_id + '-slides',
78 'play_path': m_slides.group(1),