]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/bigo.py
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
5 from ..utils
import ExtractorError
, urlencode_postdata
8 class BigoIE(InfoExtractor
):
9 _VALID_URL
= r
'https?://(?:www\.)?bigo\.tv/(?:[a-z]{2,}/)?(?P<id>[^/]+)'
12 'url': 'https://www.bigo.tv/ja/221338632',
14 'id': '6576287577575737440',
15 'title': '土よ〜💁♂️ 休憩室/REST room',
16 'thumbnail': r
're:https?://.+',
18 'uploader_id': '221338632',
23 'url': 'https://www.bigo.tv/th/Tarlerm1304',
24 'only_matching': True,
26 'url': 'https://bigo.tv/115976881',
27 'only_matching': True,
30 def _real_extract(self
, url
):
31 user_id
= self
._match
_id
(url
)
33 info_raw
= self
._download
_json
(
34 'https://bigo.tv/studio/getInternalStudioInfo',
35 user_id
, data
=urlencode_postdata({'siteId': user_id}
))
37 if info_raw
.get('code'):
39 f
'{info_raw["msg"]} (code {info_raw["code"]})', expected
=True)
40 info
= info_raw
.get('data') or {}
42 if not info
.get('alive'):
43 raise ExtractorError('This user is offline.', expected
=True)
46 'id': info
.get('roomId') or user_id
,
47 'title': info
.get('roomTopic'),
49 'url': info
.get('hls_src'),
53 'thumbnail': info
.get('snapshot'),
54 'uploader': info
.get('nick_name'),
55 'uploader_id': user_id
,