{"record":{"id":"8f66c70fd7ad811b","repo":"yt-dlp/yt-dlp","slug":"unable-to-extract-secondary-user-id-if-you-are-ab","errorCode":null,"errorMessage":"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)","messagePattern":"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\\)","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"yt_dlp/extractor/tiktok.py","lineNumber":1195,"sourceCode":"                'Downloading user webpage', 'Unable to download user webpage',\n                impersonate=True, fatal=False, headers=self._generate_blockbuster_headers()) or ''\n            detail = traverse_obj(\n                self._get_universal_data(webpage, user_name), ('webapp.user-detail', {dict})) or {}\n            video_count = traverse_obj(detail, ('userInfo', ('stats', 'statsV2'), 'videoCount', {int}, any))\n            if not video_count and detail.get('statusCode') == 10222:\n                self.raise_login_required(\n                    'This user\\'s account is private. Log into an account that has access')\n            elif video_count == 0:\n                raise ExtractorError('This account does not have any videos posted', expected=True)\n            sec_uid = traverse_obj(detail, ('userInfo', 'user', 'secUid', {str}))\n            if sec_uid:\n                fail_early = not traverse_obj(detail, ('userInfo', 'itemList', ...))\n            else:\n                sec_uid = self._extract_sec_uid_from_embed(user_name)\n                fail_early = False\n\n        if not sec_uid:\n            raise ExtractorError(\n                'Unable to extract secondary user ID. If you are able to get the channel_id '\n                'from a video posted by this user, try using \"tiktokuser:channel_id\" as the '\n                'input URL (replacing `channel_id` with its actual value)', expected=True)\n\n        return self.playlist_result(self._entries(sec_uid, user_name, fail_early), sec_uid, user_name)\n\n\nclass TikTokBaseListIE(TikTokBaseIE):  # XXX: Conventionally, base classes should end with BaseIE/InfoExtractor\n    def _entries(self, list_id, display_id):\n        query = {\n            self._QUERY_NAME: list_id,\n            'cursor': 0,\n            'count': 20,\n            'type': 5,\n            'device_id': self._DEVICE_ID,\n        }\n\n        for page in itertools.count(1):","sourceCodeStart":1177,"sourceCodeEnd":1213,"githubUrl":"https://github.com/yt-dlp/yt-dlp/blob/81ecd58b1394793e6da9998cc19fdb45657f1685/yt_dlp/extractor/tiktok.py#L1177-L1213","documentation":"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.","triggerScenarios":"Thrown at yt_dlp/extractor/tiktok.py:1195 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use \"tiktokuser:channel_id\" as input with the real channel_id"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"81ecd58b1394793e6da9998cc19fdb45657f1685","analyzedAt":"2026-08-22T12:21:25.439Z","schemaVersion":2},"datasetVersion":"2026-08-22T14:17:55.899Z"}