]>
Commit | Line | Data |
---|---|---|
7e70ac36 JMF |
1 | from __future__ import unicode_literals |
2 | ||
4b6462fc JMF |
3 | import re |
4 | ||
5 | from .common import InfoExtractor | |
6 | ||
7 | ||
8 | class BloombergIE(InfoExtractor): | |
c0ade33e | 9 | _VALID_URL = r'https?://www\.bloomberg\.com/video/(?P<name>.+?)\.html' |
4b6462fc JMF |
10 | |
11 | _TEST = { | |
7e70ac36 | 12 | 'url': 'http://www.bloomberg.com/video/shah-s-presentation-on-foreign-exchange-strategies-qurhIVlJSB6hzkVi229d8g.html', |
31bb8d3f | 13 | # The md5 checksum changes |
7e70ac36 JMF |
14 | 'info_dict': { |
15 | 'id': 'qurhIVlJSB6hzkVi229d8g', | |
16 | 'ext': 'flv', | |
17 | 'title': 'Shah\'s Presentation on Foreign-Exchange Strategies', | |
18 | 'description': 'md5:0681e0d30dcdfc6abf34594961d8ea88', | |
4b6462fc JMF |
19 | }, |
20 | } | |
21 | ||
22 | def _real_extract(self, url): | |
23 | mobj = re.match(self._VALID_URL, url) | |
24 | name = mobj.group('name') | |
25 | webpage = self._download_webpage(url, name) | |
7e70ac36 JMF |
26 | f4m_url = self._search_regex( |
27 | r'<source src="(https?://[^"]+\.f4m.*?)"', webpage, | |
28 | 'f4m url') | |
29 | title = re.sub(': Video$', '', self._og_search_title(webpage)) | |
30 | ||
31 | return { | |
32 | 'id': name.split('-')[-1], | |
33 | 'title': title, | |
31bb8d3f | 34 | 'formats': self._extract_f4m_formats(f4m_url, name), |
7e70ac36 JMF |
35 | 'description': self._og_search_description(webpage), |
36 | 'thumbnail': self._og_search_thumbnail(webpage), | |
37 | } |