ytdl-org/youtube-dl · error · ExtractorError

Bigo says: %s (code %s)

Error message

Bigo says: %s (code %s)

What it means

Raised by BigoIE._real_extract when the studio-info JSON is a dict but its 'code' field is truthy — Bigo's own error envelope. The message interpolates the API's 'msg' and 'code' fields verbatim (e.g. 'Bigo says: user not exist (code 1001)'). Marked expected=True, i.e. a legitimate server-side rejection, commonly unknown users or invalid siteIds.

Source

Thrown at youtube_dl/extractor/bigo.py:40

    }, {
        'url': 'https://www.bigo.tv/th/Tarlerm1304',
        'only_matching': True,
    }, {
        'url': 'https://bigo.tv/115976881',
        'only_matching': True,
    }]

    def _real_extract(self, url):
        user_id = self._match_id(url)

        info_raw = self._download_json(
            'https://bigo.tv/studio/getInternalStudioInfo',
            user_id, data=urlencode_postdata({'siteId': user_id}))

        if not isinstance(info_raw, dict):
            raise ExtractorError('Received invalid JSON data')
        if info_raw.get('code'):
            raise ExtractorError(
                'Bigo says: %s (code %s)' % (info_raw.get('msg'), info_raw.get('code')), expected=True)
        info = info_raw.get('data') or {}

        if not info.get('alive'):
            raise ExtractorError('This user is offline.', expected=True)

        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',
            }],
            'thumbnail': info.get('snapshot'),
            'uploader': info.get('nick_name'),
            'uploader_id': user_id,
            'is_live': True,

View on GitHub (pinned to 956b8c5855)

Solutions

  1. Open https://bigo.tv/<user_id> in a browser to confirm the channel still exists.
  2. Match the (code, msg) pair against Bigo's response — 'user not exist'-style messages mean the id is wrong/dead; pick the id from the channel page URL.
  3. If the channel exists but every id fails, the endpoint or its parameters changed; inspect the site's network calls and update the POST in bigo.py:40.
  4. Treat as expected in callers and surface the API msg to the user.
Defensive patterns

Strategy: try-catch

Try / catch

try:
    ydl.extract_info('https://bigo.tv/%s' % user_id)
except ExtractorError as e:
    m = re.search(r'Bigo says: (.*?) \(code (\S+)\)', str(e))
    if m:
        handle_bigo_api_error(user_id, m.group(1), m.group(2))  # expected; classify by code
    else:
        raise

Prevention

When it happens

Trigger: POSTing siteId=<user_id> to getInternalStudioInfo where the id does not exist, the account was banned/deleted, or the API rejects the request for another server-side reason and returns {'code': <nonzero>, 'msg': <reason>} with no 'data' payload.

Common situations: Typo'd or stale Bigo user id from an old link; streamer deleted their account; URL matched the _VALID_URL pattern but the numeric id is malformed; API code semantics changed so previously valid ids now fail.

Related errors


AI-assisted analysis of ytdl-org/youtube-dl@956b8c5855 (2026-08-14). Data as JSON: /api/errors/8297e9ce722be05e. Report an issue: GitHub.