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

Code before:
            self._API_HEADERS['Authorization'] = f'Bearer {guest["auth_token"]}'

    def _entries(self, username, user_id, limit=6):
        query = {'limit': limit}
        for page in itertools.count(1):
            videos = self._download_json(
                f'{self._API_BASE_URL}/api/users/{user_id}/videos',
                username, note=f'Downloading user video list page {page}',
                headers=self._API_HEADERS, query=query)

            for video in traverse_obj(videos, ('videos', ...)):
                yield self._parse_video_info(video, username, user_id)

            query['before_time'] = traverse_obj(videos, ('videos', -1, 'timestamp'))
            if not query['before_time']:
                break

    def _real_extract(self, url):
        username = self._match_id(url)

        user_info = traverse_obj(self._download_json(
            f'{self._API_BASE_URL}/api/users/by_username/{username}',
            username, note='Downloading user info', headers=self._API_HEADERS), ('user', {dict})) or {}

        is_followed = user_info.get('followed_by_me')
        if user_info.get('private') and not (is_followed == 'true' or is_followed is True):
            raise ExtractorError('This user profile is private', expected=True)
        elif traverse_obj(user_info, (('blocked_by_user', 'blocking_user'), {bool}), get_all=False):
            raise ExtractorError('The author of the video is blocked', expected=True)

        user_id = str_or_none(user_info.get('user_id'))
        if not user_id:
            raise ExtractorError('Unable to extract user ID')

        return self.playlist_result(
            self._entries(username, user_id), user_id, username, thumbnail=user_info.get('avatar_url'))


class TrillerShortIE(InfoExtractor):
    _VALID_URL = r'https?://v\.triller\.co/(?P<id>\w+)'
    _TESTS = [{
        'url': 'https://v.triller.co/WWZNWk',
        'md5': '5eb8dc2c971bd8cd794ec9e8d5e9d101',
        'info_dict': {
            'id': '66210052',
            'ext': 'mp4',
            'title': 'md5:2dfc89d154cd91a4a18cd9582ba03e16',
            'display_id': 'f4480e1f-fb4e-45b9-a44c-9e6c679ce7eb',
            'thumbnail': r're:^https://uploads\.cdn\.triller\.co/.+\.jpg$',
            'description': 'md5:2dfc89d154cd91a4a18cd9582ba03e16',
            'uploader': 'statefairent',

Review comment (suggestion):
```suggestion
        if user_info.get('private') and user_info.get('followed_by_me') not in (True, 'true'):
```

Code after:
            self._API_HEADERS['Authorization'] = f'Bearer {guest["auth_token"]}'

    def _entries(self, username, user_id, limit=6):
        query = {'limit': limit}
        for page in itertools.count(1):
            videos = self._download_json(
                f'{self._API_BASE_URL}/api/users/{user_id}/videos',
                username, note=f'Downloading user video list page {page}',
                headers=self._API_HEADERS, query=query)

            for video in traverse_obj(videos, ('videos', ...)):
                yield self._parse_video_info(video, username, user_id)

            query['before_time'] = traverse_obj(videos, ('videos', -1, 'timestamp'))
            if not query['before_time']:
                break

    def _real_extract(self, url):
        username = self._match_id(url)

        user_info = traverse_obj(self._download_json(
            f'{self._API_BASE_URL}/api/users/by_username/{username}',
            username, note='Downloading user info', headers=self._API_HEADERS), ('user', {dict})) or {}

        if user_info.get('private') and user_info.get('followed_by_me') not in (True, 'true'):
            raise ExtractorError('This user profile is private', expected=True)
        elif traverse_obj(user_info, (('blocked_by_user', 'blocking_user'), {bool}), get_all=False):
            raise ExtractorError('The author of the video is blocked', expected=True)

        user_id = str_or_none(user_info.get('user_id'))
        if not user_id:
            raise ExtractorError('Unable to extract user ID')

        return self.playlist_result(
            self._entries(username, user_id), user_id, username, thumbnail=user_info.get('avatar_url'))


class TrillerShortIE(InfoExtractor):
    _VALID_URL = r'https?://v\.triller\.co/(?P<id>\w+)'
    _TESTS = [{
        'url': 'https://v.triller.co/WWZNWk',
        'md5': '5eb8dc2c971bd8cd794ec9e8d5e9d101',
        'info_dict': {
            'id': '66210052',
            'ext': 'mp4',
            'title': 'md5:2dfc89d154cd91a4a18cd9582ba03e16',
            'display_id': 'f4480e1f-fb4e-45b9-a44c-9e6c679ce7eb',
            'thumbnail': r're:^https://uploads\.cdn\.triller\.co/.+\.jpg$',
            'description': 'md5:2dfc89d154cd91a4a18cd9582ba03e16',
            'uploader': 'statefairent',
            'uploader_id': '487545193',