2 from __future__ import unicode_literals
6 from .common import InfoExtractor
7 from ..utils import remove_start
10 class TeleMBIE(InfoExtractor):
11 _VALID_URL = r'https?://(?:www\.)?telemb\.be/(?P<display_id>.+?)_d_(?P<id>\d+)\.html'
14 'url': 'http://www.telemb.be/mons-cook-with-danielle-des-cours-de-cuisine-en-anglais-_d_13466.html',
15 'md5': 'f45ea69878516ba039835794e0f8f783',
18 'display_id': 'mons-cook-with-danielle-des-cours-de-cuisine-en-anglais-',
20 'title': 'Mons - Cook with Danielle : des cours de cuisine en anglais ! - Les reportages',
21 'description': 'md5:bc5225f47b17c309761c856ad4776265',
22 'thumbnail': 're:^http://.*\.(?:jpg|png)$',
26 'url': 'http://telemb.be/les-reportages-havre-incendie-mortel_d_13514.html',
27 'md5': '6e9682736e5ccd4eab7f21e855350733',
30 'display_id': 'les-reportages-havre-incendie-mortel',
32 'title': 'Havré - Incendie mortel - Les reportages',
33 'description': 'md5:5e54cb449acb029c2b7734e2d946bd4a',
34 'thumbnail': 're:^http://.*\.(?:jpg|png)$',
39 def _real_extract(self, url):
40 mobj = re.match(self._VALID_URL, url)
41 video_id = mobj.group('id')
42 display_id = mobj.group('display_id')
44 webpage = self._download_webpage(url, display_id)
47 for video_url in re.findall(r'file\s*:\s*"([^"]+)"', webpage):
50 'format_id': video_url.split(':')[0]
52 rtmp = re.search(r'^(?P<url>rtmp://[^/]+/(?P<app>.+))/(?P<playpath>mp4:.+)$', video_url)
55 'play_path': rtmp.group('playpath'),
56 'app': rtmp.group('app'),
57 'player_url': 'http://p.jwpcdn.com/6/10/jwplayer.flash.swf',
58 'page_url': 'http://www.telemb.be',
62 self._sort_formats(formats)
64 title = remove_start(self._og_search_title(webpage), 'TéléMB : ')
65 description = self._html_search_regex(
66 r'<meta property="og:description" content="(.+?)" />',
67 webpage, 'description', fatal=False)
68 thumbnail = self._og_search_thumbnail(webpage)
72 'display_id': display_id,
74 'description': description,
75 'thumbnail': thumbnail,