Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/tiktok.py (Python)

Code before:
    def _real_extract(self, url):
        id = self._match_id(url)
        webpage = self._download_webpage(url, id)
        user_id = re.search(r'\"id\":\"(?P<userid>\d+)', webpage)
        if not user_id:
            raise ExtractorError('Cookies are required to download from TikTok user account.', expected=True)
        user_id = user_id.group('userid')
        secuid = re.search(r'\"secUid\":\"(?P<secUid>[^\"]+)', webpage).group('secUid')
        verifyFp_cookie = self._get_cookies('https://www.tiktok.com').get('s_v_web_id')
        if not verifyFp_cookie:
            raise ExtractorError('Improper cookies (missing s_v_web_id).', expected=True)
        api_url = f'https://m.tiktok.com/api/post/item_list/?aid=1988&cookie_enabled=true&count=30&verifyFp={verifyFp_cookie.value}&secUid={secuid}&cursor='
        hasMore = True
        cursor = '0'
        entries = []
        page = 0
        while hasMore:
            data_json = self._download_json(api_url + cursor, user_id, note='Downloading Page %d' % page)
            cursor = data_json['cursor']
            hasMore = data_json['hasMore']
            videos = data_json.get('itemList', [])
            for video in videos:
                video_id = video['id']
                entries.append(self.url_result('https://www.tiktok.com/@%s/video/%s' % (id, video_id),
                                               ie=TikTokIE.ie_key(),
                                               video_id=video_id))
            page += 1
        return self.playlist_result(entries, user_id)


Review comment (suggestion):
```suggestion
                entries.append(self.url_result('https://www.tiktok.com/@%s/video/%s' % (id, video_id),
                                               ie=TikTokIE.ie_key(), video_id=video_id))
```

Code after:
                    'extractor': 'TikTok',
                    'url': download_url,
                    'ext': 'mp4',
                    'height': height,
                    'width': width,
                    'title': str_or_none(video.get('desc')),
                    'duration': try_get(video, lambda x: x['video']['duration'], int),
                    'view_count': try_get(video, lambda x: x['stats']['playCount'], int),
                    'like_count': try_get(video, lambda x: x['stats']['diggCount'], int),
                    'comment_count': try_get(video, lambda x: x['stats']['commentCount'], int),
                    'repost_count': try_get(video, lambda x: x['stats']['shareCount'], int),
                    'timestamp': video.get('createTime'),
                    'creator': try_get(video, lambda x: x['author']['nickname'], str),
                    'uploader': try_get(video, lambda x: x['author']['uniqueId'], str),
                    'uploader_id': try_get(video, lambda x: x['author']['id'], str),
                    'uploader_url': f'https://www.tiktok.com/@{user_id}',
                    'thumbnails': [{'url': thumbnail, 'height': height, 'width': width}],
                    'description': str_or_none(video.get('desc')),
                    'webpage_url': video_url,
                    'http_headers': {
                        'Referer': video_url,
                    }
                }
            if not data_json['hasMore']:
                break
            cursor = data_json['cursor']

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