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

Code before:
from .common import InfoExtractor
from ..utils import (
    traverse_obj,
    unified_timestamp,
)


class FourZeroStudioBaseIE(InfoExtractor):

    @staticmethod
    def _extract_uploader_info(nuxt_data):
        uploader_info = traverse_obj(nuxt_data, ('ssrRefs', lambda _, v: v['__typename'] == 'PublicUser'), get_all=False)
        return {
            'uploader': uploader_info.get('username'),
        }


class FourZeroStudioArchiveIE(FourZeroStudioBaseIE):
    _VALID_URL = r'https?://0000\.studio/(?P<uploader_id>[^/]+)/broadcasts/(?P<id>[^/]+)/archive'
    IE_NAME = '0000studio:archive'
    _TESTS = [{
        'url': 'https://0000.studio/mumeijiten/broadcasts/1290f433-fce0-4909-a24a-5f7df09665dc/archive',
        'info_dict': {
            'id': '1290f433-fce0-4909-a24a-5f7df09665dc',
            'title': 'noteで『canape』様へのファンレターを執筆します。（数秘術その2）',
            'timestamp': 1653802534,
            'release_timestamp': 1653796604,
            'thumbnails': 'count:1',
            'comments': 'count:7',
            'uploader': '『中崎雄心』の執務室。',
            '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)

Review comment (suggestion):
```suggestion
        return {
            'uploader': traverse_obj(nuxt_data, (
                'ssrRefs', lambda _, v: v['__typename'] == 'PublicUser', 'username'), get_all=False),
        }
```
The function (and the baseIE) isn't even needed imo

Code after:
from .common import InfoExtractor
from ..utils import (
    traverse_obj,
    unified_timestamp,
)


class FourZeroStudioArchiveIE(InfoExtractor):
    _VALID_URL = r'https?://0000\.studio/(?P<uploader_id>[^/]+)/broadcasts/(?P<id>[^/]+)/archive'
    IE_NAME = '0000studio:archive'
    _TESTS = [{
        'url': 'https://0000.studio/mumeijiten/broadcasts/1290f433-fce0-4909-a24a-5f7df09665dc/archive',
        'info_dict': {
            'id': '1290f433-fce0-4909-a24a-5f7df09665dc',
            'title': 'noteで『canape』様へのファンレターを執筆します。（数秘術その2）',
            'timestamp': 1653802534,
            'release_timestamp': 1653796604,
            'thumbnails': 'count:1',
            'comments': 'count:7',
            'uploader': '『中崎雄心』の執務室。',
            '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, return_full_data=True)

        pcb = traverse_obj(nuxt_data, ('ssrRefs', lambda _, v: v['__typename'] == 'PublicCreatorBroadcast'), get_all=False)
        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,