]> jfr.im git - yt-dlp.git/commitdiff
[extractor/bigo] Fix extractor (#4312)
authorLesmiscore (Naoya Ozaki) <redacted>
Sat, 9 Jul 2022 09:30:34 +0000 (18:30 +0900)
committerGitHub <redacted>
Sat, 9 Jul 2022 09:30:34 +0000 (15:00 +0530)
Closes #4139

Authored by: Lesmiscore

yt_dlp/extractor/bigo.py

index f39e15002e5d28039beb50cfa3a6f41dc738dda6..1cb6e58be68ceab1df2e588a2cfc2840175df417 100644 (file)
@@ -28,7 +28,7 @@ def _real_extract(self, url):
         user_id = self._match_id(url)
 
         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}))
 
         if not isinstance(info_raw, dict):
@@ -41,14 +41,14 @@ def _real_extract(self, url):
         if not info.get('alive'):
             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 {
             'id': info.get('roomId') or user_id,
             'title': info.get('roomTopic') or info.get('nick_name') or user_id,
-            'formats': [{
-                'url': info.get('hls_src'),
-                'ext': 'mp4',
-                'protocol': 'm3u8',
-            }],
+            'formats': formats,
+            'subtitles': subs,
             'thumbnail': info.get('snapshot'),
             'uploader': info.get('nick_name'),
             'uploader_id': user_id,