mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-25 20:55:52 +01:00
[extractor/bigo] Fix extractor (#4312)
Closes #4139 Authored by: Lesmiscore
This commit is contained in:
parent
170a031386
commit
1275aeb955
@ -28,7 +28,7 @@ def _real_extract(self, url):
|
|||||||
user_id = self._match_id(url)
|
user_id = self._match_id(url)
|
||||||
|
|
||||||
info_raw = self._download_json(
|
info_raw = self._download_json(
|
||||||
'https://bigo.tv/studio/getInternalStudioInfo',
|
'https://ta.bigo.tv/official_website/studio/getInternalStudioInfo',
|
||||||
user_id, data=urlencode_postdata({'siteId': user_id}))
|
user_id, data=urlencode_postdata({'siteId': user_id}))
|
||||||
|
|
||||||
if not isinstance(info_raw, dict):
|
if not isinstance(info_raw, dict):
|
||||||
@ -41,14 +41,14 @@ def _real_extract(self, url):
|
|||||||
if not info.get('alive'):
|
if not info.get('alive'):
|
||||||
raise ExtractorError('This user is offline.', expected=True)
|
raise ExtractorError('This user is offline.', expected=True)
|
||||||
|
|
||||||
|
formats, subs = self._extract_m3u8_formats_and_subtitles(
|
||||||
|
info.get('hls_src'), user_id, 'mp4', 'm3u8')
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': info.get('roomId') or user_id,
|
'id': info.get('roomId') or user_id,
|
||||||
'title': info.get('roomTopic') or info.get('nick_name') or user_id,
|
'title': info.get('roomTopic') or info.get('nick_name') or user_id,
|
||||||
'formats': [{
|
'formats': formats,
|
||||||
'url': info.get('hls_src'),
|
'subtitles': subs,
|
||||||
'ext': 'mp4',
|
|
||||||
'protocol': 'm3u8',
|
|
||||||
}],
|
|
||||||
'thumbnail': info.get('snapshot'),
|
'thumbnail': info.get('snapshot'),
|
||||||
'uploader': info.get('nick_name'),
|
'uploader': info.get('nick_name'),
|
||||||
'uploader_id': user_id,
|
'uploader_id': user_id,
|
||||||
|
Loading…
Reference in New Issue
Block a user