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

Code before:
            'uploader_id': 'mumeijiten',
        }
    }]

    def _real_extract(self, url):
        video_id, uploader_id = self._match_valid_url(url).group('id', 'uploader_id')
        webpage = self._download_webpage(url, video_id)
        nuxt_data = self._search_nuxt_data(webpage, video_id, full_data=True)

        pcb = traverse_obj(nuxt_data, ('ssrRefs', lambda _, v: v['__typename'] == 'PublicCreatorBroadcast'), get_all=False)
        comments = traverse_obj(nuxt_data, ('ssrRefs', ..., lambda _, v: v['__typename'] == 'PublicCreatorBroadcastComment'))

        formats, subs = self._extract_m3u8_formats_and_subtitles(
            pcb.get('archiveUrl'), video_id, ext='mp4')
        self._sort_formats(formats)

        return {
            'id': video_id,
            'title': pcb.get('title'),
            'age_limit': 18 if pcb.get('isAdult') else None,
            'timestamp': unified_timestamp(pcb.get('finishTime')),
            'release_timestamp': unified_timestamp(pcb.get('createdAt')),
            'thumbnails': [{
                'url': pcb.get('thumbnailUrl'),
                'ext': 'png',
            }],
            'formats': formats,
            'subtitles': subs,
            'comments': comments,
            'comment_count': len(comments),
            'uploader_id': uploader_id,
            **self._extract_uploader_info(nuxt_data),
        }


class FourZeroStudioClipIE(FourZeroStudioBaseIE):
    _VALID_URL = r'https?://0000\.studio/(?P<uploader_id>[^/]+)/archive-clip/(?P<id>[^/]+)'
    IE_NAME = '0000studio:clip'
    _TESTS = [{
        'url': 'https://0000.studio/soeji/archive-clip/e46b0278-24cd-40a8-92e1-b8fc2b21f34f',
        'info_dict': {
            'id': 'e46b0278-24cd-40a8-92e1-b8fc2b21f34f',
            'title': 'わたベーさんからイラスト差し入れいただきました。ありがとうございました！',
            'timestamp': 1652109105,
            'like_count': 1,
            'uploader': 'ソエジマケイタ',
            'uploader_id': 'soeji',
        }
    }]

    def _real_extract(self, url):

Review comment (suggestion):
```suggestion
            'thumbnails': [{
                'url': pcb['thumbnailUrl'],
                'ext': 'png',
            }] if pcb.get('thumbnailUrl') else None,
```

Code after:
        uploader_internal_id = traverse_obj(nuxt_data, (
            'ssrRefs', lambda _, v: v['__typename'] == 'PublicUser', 'id'), get_all=False)

        formats, subs = self._extract_m3u8_formats_and_subtitles(pcb['archiveUrl'], video_id, ext='mp4')
        self._sort_formats(formats)

        return {
            'id': video_id,
            'title': pcb.get('title'),
            'age_limit': 18 if pcb.get('isAdult') else None,
            'timestamp': unified_timestamp(pcb.get('finishTime')),
            'release_timestamp': unified_timestamp(pcb.get('createdAt')),
            'thumbnails': [{
                'url': pcb['thumbnailUrl'],
                'ext': 'png',
            }] if pcb.get('thumbnailUrl') else None,
            'formats': formats,
            'subtitles': subs,
            'comments': [{
                'author': c.get('username'),
                'author_id': c.get('postedUserId'),
                'author_thumbnail': c.get('userThumbnailUrl'),
                'id': c.get('id'),
                'text': c.get('body'),
                'timestamp': unified_timestamp(c.get('createdAt')),
                'like_count': c.get('likeCount'),
                'is_favorited': c.get('isLikedByOwner'),
                'author_is_uploader': c.get('postedUserId') == uploader_internal_id,
            } for c in traverse_obj(nuxt_data, (
                'ssrRefs', ..., lambda _, v: v['__typename'] == 'PublicCreatorBroadcastComment')) or []],
            'uploader_id': uploader_id,
            'uploader': traverse_obj(nuxt_data, (
                'ssrRefs', lambda _, v: v['__typename'] == 'PublicUser', 'username'), get_all=False),
        }


class FourZeroStudioClipIE(InfoExtractor):
    _VALID_URL = r'https?://0000\.studio/(?P<uploader_id>[^/]+)/archive-clip/(?P<id>[^/]+)'
    IE_NAME = '0000studio:clip'
    _TESTS = [{
        'url': 'https://0000.studio/soeji/archive-clip/e46b0278-24cd-40a8-92e1-b8fc2b21f34f',
        'info_dict': {
            'id': 'e46b0278-24cd-40a8-92e1-b8fc2b21f34f',
            'title': 'わたベーさんからイラスト差し入れいただきました。ありがとうございました！',
            'timestamp': 1652109105,
            'like_count': 1,
            'uploader': 'ソエジマケイタ',
            'uploader_id': 'soeji',
        }
    }]