1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-10-21 17:58:38 +00:00

[ie/tiktok:user] Fix private account extraction (#14585)

Closes #14565
Authored by: CasualYT31
This commit is contained in:
CasualYouTuber31 2025-10-14 20:42:36 +01:00 committed by GitHub
parent c2e124881f
commit cdc533b114
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1074,9 +1074,12 @@ def _real_extract(self, url):
fatal=False, impersonate=True) or ''
detail = traverse_obj(
self._get_universal_data(webpage, user_name), ('webapp.user-detail', {dict})) or {}
if detail.get('statusCode') == 10222:
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', ...))