]> Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/bloomberg.py
Update changelog.
[youtubedl] / youtube_dl / extractor / bloomberg.py
1 from __future__ import unicode_literals
2
3 import re
4
5 from .common import InfoExtractor
6
7
8 class BloombergIE(InfoExtractor):
9 _VALID_URL = r'https?://www\.bloomberg\.com/video/(?P<name>.+?)\.html'
10
11 _TEST = {
12 'url': 'http://www.bloomberg.com/video/shah-s-presentation-on-foreign-exchange-strategies-qurhIVlJSB6hzkVi229d8g.html',
13 # The md5 checksum changes
14 'info_dict': {
15 'id': 'qurhIVlJSB6hzkVi229d8g',
16 'ext': 'flv',
17 'title': 'Shah\'s Presentation on Foreign-Exchange Strategies',
18 'description': 'md5:0681e0d30dcdfc6abf34594961d8ea88',
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)
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,
34 'formats': self._extract_f4m_formats(f4m_url, name),
35 'description': self._og_search_description(webpage),
36 'thumbnail': self._og_search_thumbnail(webpage),
37 }