3 from .common
import InfoExtractor
4 from ..utils
import int_or_none
7 class RTL2IE(InfoExtractor
):
9 _VALID_URL
= r
'https?://(?:www\.)?rtl2\.de/sendung/[^/]+/(?:video/(?P<vico_id>\d+)[^/]+/(?P<vivi_id>\d+)-|folge/)(?P<id>[^/?#]+)'
11 'url': 'http://www.rtl2.de/sendung/grip-das-motormagazin/folge/folge-203-0',
15 'title': 'GRIP sucht den Sommerkönig',
16 'description': 'md5:e3adbb940fd3c6e76fa341b8748b562f'
20 'skip_download': True,
22 'expected_warnings': ['Unable to download f4m manifest', 'Failed to download m3u8 information'],
24 'url': 'http://www.rtl2.de/sendung/koeln-50667/video/5512-anna/21040-anna-erwischt-alex/',
26 'id': 'anna-erwischt-alex',
28 'title': 'Anna erwischt Alex!',
29 'description': 'Anna nimmt ihrem Vater nicht ab, dass er nicht spielt. Und tatsächlich erwischt sie ihn auf frischer Tat.'
33 'skip_download': True,
35 'expected_warnings': ['Unable to download f4m manifest', 'Failed to download m3u8 information'],
38 def _real_extract(self
, url
):
39 vico_id
, vivi_id
, display_id
= self
._match
_valid
_url
(url
).groups()
41 webpage
= self
._download
_webpage
(url
, display_id
)
44 r
'data-collection="(?P<vico_id>\d+)"[^>]+data-video="(?P<vivi_id>\d+)"',
47 vico_id
= mobj
.group('vico_id')
48 vivi_id
= mobj
.group('vivi_id')
50 vico_id
= self
._html
_search
_regex
(
51 r
'vico_id\s*:\s*([0-9]+)', webpage
, 'vico_id')
52 vivi_id
= self
._html
_search
_regex
(
53 r
'vivi_id\s*:\s*([0-9]+)', webpage
, 'vivi_id')
55 info
= self
._download
_json
(
56 'https://service.rtl2.de/api-player-vipo/video.php',
61 video_info
= info
['video']
62 title
= video_info
['titel']
66 rtmp_url
= video_info
.get('streamurl')
68 rtmp_url
= rtmp_url
.replace('\\', '')
69 stream_url
= 'mp4:' + self
._html
_search
_regex
(r
'/ondemand/(.+)', rtmp_url
, 'stream URL')
70 rtmp_conn
= ['S:connect', 'O:1', 'NS:pageUrl:' + url
, 'NB:fpad:0', 'NN:videoFunction:1', 'O:0']
75 'play_path': stream_url
,
76 'player_url': 'https://www.rtl2.de/sites/default/modules/rtl2/jwplayer/jwplayer-7.6.0/jwplayer.flash.swf',
78 'flash_version': 'LNX 11,2,202,429',
79 'rtmp_conn': rtmp_conn
,
84 m3u8_url
= video_info
.get('streamurl_hls')
86 formats
.extend(self
._extract
_akamai
_formats
(m3u8_url
, display_id
))
91 'thumbnail': video_info
.get('image'),
92 'description': video_info
.get('beschreibung'),
93 'duration': int_or_none(video_info
.get('duration')),