2 from __future__ import unicode_literals
4 from .common import InfoExtractor
5 from ..compat import compat_str
12 class AliExpressLiveIE(InfoExtractor):
13 _VALID_URL = r'https?://live\.aliexpress\.com/live/(?P<id>\d+)'
15 'url': 'https://live.aliexpress.com/live/2800002704436634',
16 'md5': 'e729e25d47c5e557f2630eaf99b740a5',
18 'id': '2800002704436634',
20 'title': 'CASIMA7.22',
21 'thumbnail': r're:http://.*\.jpg',
22 'uploader': 'CASIMA Official Store',
23 'timestamp': 1500717600,
24 'upload_date': '20170722',
28 def _real_extract(self, url):
29 video_id = self._match_id(url)
31 webpage = self._download_webpage(url, video_id)
33 data = self._parse_json(
35 r'(?s)runParams\s*=\s*({.+?})\s*;?\s*var',
36 webpage, 'runParams'),
41 formats = self._extract_m3u8_formats(
42 data['replyStreamUrl'], video_id, 'mp4',
43 entry_protocol='m3u8_native', m3u8_id='hls')
48 'thumbnail': data.get('coverUrl'),
50 data, lambda x: x['followBar']['name'], compat_str),
51 'timestamp': float_or_none(data.get('startTimeLong'), scale=1000),