{"record":{"id":"da1111e809b76389","repo":"ytdl-org/youtube-dl","slug":"this-video-is-private","errorCode":null,"errorMessage":"This video is private","messagePattern":"This video is private","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/tiktok.py","lineNumber":115,"sourceCode":"            'comment_count': int,\n            'repost_count': int,\n        }\n    }]\n\n    def _real_initialize(self):\n        # Setup session (will set necessary cookies)\n        self._request_webpage(\n            'https://www.tiktok.com/', None, note='Setting up session')\n\n    def _real_extract(self, url):\n        video_id = self._match_id(url)\n        webpage = self._download_webpage(url, video_id)\n        page_props = self._parse_json(self._search_regex(\n            r'<script[^>]+\\bid=[\"\\']__NEXT_DATA__[^>]+>\\s*({.+?})\\s*</script',\n            webpage, 'data'), video_id)['props']['pageProps']\n        data = try_get(page_props, lambda x: x['itemInfo']['itemStruct'], dict)\n        if not data and page_props.get('statusCode') == 10216:\n            raise ExtractorError('This video is private', expected=True)\n        return self._extract_video(data, video_id)\n\n\nclass TikTokUserIE(TikTokBaseIE):\n    _VALID_URL = r'https://(?:www\\.)?tiktok\\.com/@(?P<id>[^/?#&]+)'\n    _TESTS = [{\n        'url': 'https://www.tiktok.com/@zureeal',\n        'info_dict': {\n            'id': '188294915489964032',\n        },\n        'playlist_mincount': 24,\n    }]\n    _WORKING = False\n\n    @classmethod\n    def suitable(cls, url):\n        return False if TikTokIE.suitable(url) else super(TikTokUserIE, cls).suitable(url)\n","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/tiktok.py#L97-L133","documentation":"Raised by TikTokIE when the __NEXT_DATA__ JSON contains no itemStruct and pageProps.statusCode equals 10216, TikTok's code for a private video. Marked expected=True, so it is presented as a definitive availability error, not a bug.","triggerScenarios":"Extracting a tiktok.com/@user/video/<id> URL for a video the owner set to private, or an account switched to private; the session-setup request succeeds but the embed page returns statusCode 10216 instead of item data.","commonSituations":"Videos made private after going viral; deleted-then-private states where TikTok keeps the id; region-blocked states that surface as 10216; old youtube-dl versions whose TikTok extraction no longer works at all because TikTok changed its page structure — in that case every URL fails, not just private ones.","solutions":["Open the URL in a logged-out browser incognito window; if TikTok says the video is private/unavailable, nothing to fix","If every TikTok URL errors, your youtube-dl is too old — update to yt-dlp which actively tracks TikTok changes","Ask the owner to make the video public or use their shared link while logged in via cookies (yt-dlp --cookies)","In batch scripts, catch expected ExtractorError and skip"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    ydl.extract_info(tiktok_url)\nexcept ExtractorError as e:\n    if e.expected and 'private' in str(e):\n        skip(url)  # statusCode 10216: permanent unless owner changes visibility","preventionTips":["Use a current yt-dlp for TikTok; the site changes weekly","For private-account content, export an authorized session's cookies","Do not retry private-video errors — they are terminal states"],"tags":["extractor","tiktok","private-video","expected"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}