]>
jfr.im git - yt-dlp.git/blob - youtube_dl/extractor/aliexpress.py
2 from __future__
import unicode_literals
7 from .common
import InfoExtractor
8 from ..utils
import try_get
, float_or_none
9 from ..compat
import compat_str
12 class AliExpressLiveIE(InfoExtractor
):
14 _VALID_URL
= r
'https?://live\.aliexpress\.com/live/(?P<id>[0-9]{16})'
16 'url': 'https://live.aliexpress.com/live/2800002704436634',
17 'md5': '7ac2bc46afdd18f0b45a0a340fc47ffe',
19 'id': '2800002704436634',
21 'title': 'CASIMA7.22',
22 'uploader': 'CASIMA Official Store',
23 'upload_date': '20170714',
24 'timestamp': 1500027138,
28 def _real_extract(self
, url
):
29 video_id
= self
._match
_id
(url
)
30 page
= self
._download
_webpage
(url
, video_id
)
31 run_params_json
= self
._search
_regex
(r
'runParams = (.+)[\s+]var myCtl', page
, 'runParams', flags
=re
.DOTALL
)
32 run_params
= self
._parse
_json
(run_params_json
, video_id
)
36 'title': run_params
['title'],
37 'url': run_params
['replyStreamUrl'],
38 'uploader': try_get(run_params
, lambda x
: x
['followBar']['name'], compat_str
),
39 'timestamp': float_or_none(try_get(run_params
, lambda x
: x
['followBar']['createTime']) / 1000),