1 from __future__ import unicode_literals
6 from .common import InfoExtractor
12 class InfoQIE(InfoExtractor):
13 _VALID_URL = r'https?://(?:www\.)?infoq\.com/[^/]+/(?P<id>[^/]+)$'
16 "url": "http://www.infoq.com/presentations/A-Few-of-My-Favorite-Python-Things",
17 "file": "12-jan-pythonthings.mp4",
19 "description": "Mike Pirnat presents some tips and tricks, standard libraries and third party packages that make programming in Python a richer experience.",
20 "title": "A Few of My Favorite [Python] Things",
23 "skip_download": True,
27 def _real_extract(self, url):
28 mobj = re.match(self._VALID_URL, url)
29 video_id = mobj.group('id')
31 webpage = self._download_webpage(url, video_id)
34 encoded_id = self._search_regex(r"jsclassref ?= ?'([^']*)'", webpage, 'encoded id')
35 real_id = compat_urllib_parse.unquote(base64.b64decode(encoded_id.encode('ascii')).decode('utf-8'))
36 video_url = 'rtmpe://video.infoq.com/cfx/st/' + real_id
39 video_title = self._search_regex(r'contentTitle = "(.*?)";',
43 video_description = self._html_search_regex(r'<meta name="description" content="(.*)"(?:\s*/)?>',
44 webpage, 'description', fatal=False)
46 video_filename = video_url.split('/')[-1]
47 video_id, extension = video_filename.split('.')
53 'ext': extension, # Extension is always(?) mp4, but seems to be flv
54 'description': video_description,