yt-dlp/yt-dlp · error · ExtractorError

Unable to extract secondary user ID. If you are able to get

Error message

Unable to extract secondary user ID. If you are able to get the channel_id from a video posted by this user, try using "tiktokuser:channel_id" as the input URL (replacing `channel_id` with its actual value)

What it means

Error "Unable to extract secondary user ID. If you are able to get the channel_id from a video posted by this user, try using "tiktokuser:channel_id" as the input URL (replacing `channel_id` with its actual value)" thrown in yt-dlp/yt-dlp.

Source

Thrown at yt_dlp/extractor/tiktok.py:1195

                'Downloading user webpage', 'Unable to download user webpage',
                impersonate=True, fatal=False, headers=self._generate_blockbuster_headers()) or ''
            detail = traverse_obj(
                self._get_universal_data(webpage, user_name), ('webapp.user-detail', {dict})) or {}
            video_count = traverse_obj(detail, ('userInfo', ('stats', 'statsV2'), 'videoCount', {int}, any))
            if not video_count and detail.get('statusCode') == 10222:
                self.raise_login_required(
                    'This user\'s account is private. Log into an account that has access')
            elif video_count == 0:
                raise ExtractorError('This account does not have any videos posted', expected=True)
            sec_uid = traverse_obj(detail, ('userInfo', 'user', 'secUid', {str}))
            if sec_uid:
                fail_early = not traverse_obj(detail, ('userInfo', 'itemList', ...))
            else:
                sec_uid = self._extract_sec_uid_from_embed(user_name)
                fail_early = False

        if not sec_uid:
            raise ExtractorError(
                'Unable to extract secondary user ID. If you are able to get the channel_id '
                'from a video posted by this user, try using "tiktokuser:channel_id" as the '
                'input URL (replacing `channel_id` with its actual value)', expected=True)

        return self.playlist_result(self._entries(sec_uid, user_name, fail_early), sec_uid, user_name)


class TikTokBaseListIE(TikTokBaseIE):  # XXX: Conventionally, base classes should end with BaseIE/InfoExtractor
    def _entries(self, list_id, display_id):
        query = {
            self._QUERY_NAME: list_id,
            'cursor': 0,
            'count': 20,
            'type': 5,
            'device_id': self._DEVICE_ID,
        }

        for page in itertools.count(1):

View on GitHub (pinned to 81ecd58b13)

Solutions

  1. Use "tiktokuser:channel_id" as input with the real channel_id

When it happens

Trigger: Thrown at yt_dlp/extractor/tiktok.py:1195 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of yt-dlp/yt-dlp@81ecd58b13 (2026-08-22). Data as JSON: /api/errors/8f66c70fd7ad811b. Report an issue: GitHub.