]>
Commit | Line | Data |
---|---|---|
2cead7e7 | 1 | # coding: utf-8 |
2 | from __future__ import unicode_literals | |
3 | ||
2cead7e7 | 4 | from .common import InfoExtractor |
5 | ||
6 | ||
7 | class TeleBruxellesIE(InfoExtractor): | |
dd60be2b | 8 | _VALID_URL = r'https?://(?:www\.)?telebruxelles\.be/(news|sport|dernier-jt)/?(?P<id>[^/#?]+)' |
2cead7e7 | 9 | _TESTS = [{ |
dd60be2b PH |
10 | 'url': 'http://www.telebruxelles.be/news/auditions-devant-parlement-francken-galant-tres-attendus/', |
11 | 'md5': '59439e568c9ee42fb77588b2096b214f', | |
2cead7e7 | 12 | 'info_dict': { |
13 | 'id': '11942', | |
dd60be2b | 14 | 'display_id': 'auditions-devant-parlement-francken-galant-tres-attendus', |
2cead7e7 | 15 | 'ext': 'flv', |
dd60be2b PH |
16 | 'title': 'Parlement : Francken et Galant répondent aux interpellations de l’opposition', |
17 | 'description': 're:Les auditions des ministres se poursuivent*' | |
18 | }, | |
19 | 'params': { | |
20 | 'skip_download': 'requires rtmpdump' | |
21 | }, | |
2cead7e7 | 22 | }, { |
dd60be2b PH |
23 | 'url': 'http://www.telebruxelles.be/sport/basket-brussels-bat-mons-80-74/', |
24 | 'md5': '181d3fbdcf20b909309e5aef5c6c6047', | |
2cead7e7 | 25 | 'info_dict': { |
26 | 'id': '10091', | |
dd60be2b | 27 | 'display_id': 'basket-brussels-bat-mons-80-74', |
2cead7e7 | 28 | 'ext': 'flv', |
29 | 'title': 'Basket : le Brussels bat Mons 80-74', | |
dd60be2b PH |
30 | 'description': 're:^Ils l\u2019on fait ! En basket, le B*', |
31 | }, | |
32 | 'params': { | |
33 | 'skip_download': 'requires rtmpdump' | |
34 | }, | |
35 | }] | |
2cead7e7 | 36 | |
37 | def _real_extract(self, url): | |
dd60be2b PH |
38 | display_id = self._match_id(url) |
39 | webpage = self._download_webpage(url, display_id) | |
2cead7e7 | 40 | |
dd60be2b PH |
41 | article_id = self._html_search_regex( |
42 | r"<article id=\"post-(\d+)\"", webpage, 'article ID') | |
43 | title = self._html_search_regex( | |
44 | r'<h1 class=\"entry-title\">(.*?)</h1>', webpage, 'title') | |
45 | description = self._og_search_description(webpage) | |
2cead7e7 | 46 | |
dd60be2b PH |
47 | rtmp_url = self._html_search_regex( |
48 | r"file: \"(rtmp://\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}:\d{1,5}/vod/mp4:\" \+ \"\w+\" \+ \".mp4)\"", | |
49 | webpage, 'RTMP url') | |
50 | rtmp_url = rtmp_url.replace("\" + \"", "") | |
51 | ||
52 | return { | |
53 | 'id': article_id, | |
54 | 'display_id': display_id, | |
55 | 'title': title, | |
56 | 'description': description, | |
57 | 'url': rtmp_url, | |
58 | 'ext': 'flv', | |
59 | 'rtmp_live': True # if rtmpdump is not called with "--live" argument, the download is blocked and can be completed | |
60 | } |