- is_live = xpath_text(hd_doc, './/video/islive') == 'true'
- if is_live:
- raise ExtractorError(
- 'Live streams are not supported by the f4m downloader.')
+ partner_id = self._search_regex(
+ r'partnerid\s*:\s*(["\'])(?P<partner_id>.+?)\1',
+ iframe, 'partner id', group='partner_id')
+
+ hd_doc = self._download_xml(
+ 'http://www.laola1.tv/server/hd_video.php?%s'
+ % compat_urllib_parse_urlencode({
+ 'play': video_id,
+ 'partner': partner_id,
+ 'portal': portal,
+ 'lang': lang,
+ 'v5ident': '',
+ }), display_id)
+
+ _v = lambda x, **k: xpath_text(hd_doc, './/video/' + x, **k)
+ title = _v('title', fatal=True)
+
+ VS_TARGETS = {
+ 'video': '2',
+ 'livestream': '17',
+ }
+
+ req = sanitized_Request(
+ 'https://club.laola1.tv/sp/laola1/api/v3/user/session/premium/player/stream-access?%s' %
+ compat_urllib_parse_urlencode({
+ 'videoId': video_id,
+ 'target': VS_TARGETS.get(kind, '2'),
+ 'label': _v('label'),
+ 'area': _v('area'),
+ }),
+ urlencode_postdata(
+ dict((i, v) for i, v in enumerate(_v('req_liga_abos').split(',')))))