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

Code before:

        return {
            'id': music_id,
            'vcodec': 'none',
            'webpage_url': webpage_url,
            'extractor_key': EggsIE.ie_key(),
            'extractor': EggsIE.IE_NAME,
            **traverse_obj(data, {
                'title': ('musicTitle', {str}),
                'url': ('musicDataPath', {url_or_none}),
                'uploader': ('artist', 'displayName', {str}),
                'uploader_id': ('artist', 'artistId', {str_or_none}),
                'thumbnail': ('imageDataPath', {url_or_none}),
                'view_count': ('numberOfMusicPlays', {int_or_none}),
                'like_count': ('numberOfLikes', {int_or_none}),
                'comment_count': ('numberOfComments', {int_or_none}),
                'composers': ('composer', {str}, all),
                'tags': ('tags', ..., {str}),
                'timestamp': ('releaseDate', {parse_iso8601}),
                'artist': ('artist', 'displayName', {str}),
            })}


class EggsIE(EggsBaseIE):
    IE_NAME = 'eggs:single'
    _VALID_URL = r'https?://eggs\.mu/artist/[^/]+/song/(?P<id>[\da-f-]+)'

    _TESTS = [{
        'url': 'https://eggs.mu/artist/32_sunny_girl/song/0e95fd1d-4d61-4d5b-8b18-6092c551da90',
        'info_dict': {
            'id': '0e95fd1d-4d61-4d5b-8b18-6092c551da90',
            'ext': 'm4a',
            'title': 'シネマと信号',
            'uploader': 'Sunny Girl',
            'thumbnail': r're:https?://.*\.jpg(?:\?.*)?$',
            'uploader_id': '1607',
            'like_count': int,
            'timestamp': 1731327327,
            'composers': ['橘高連太郎'],
            'view_count': int,
            'comment_count': int,
            'artists': ['Sunny Girl'],
            'upload_date': '20241111',
            'tags': ['SunnyGirl', 'シネマと信号'],
        },
    }, {
        'url': 'https://eggs.mu/artist/KAMO_3pband/song/1d4bc45f-1af6-47a9-8b30-a70cae350b4f',
        'info_dict': {
            'id': '80cLKA2wnoA',
            'ext': 'mp4',
            'title': 'KAMO「いい女だから」Audio',

Review comment (suggestion):
```suggestion
    _VALID_URL = r'https?://eggs\.mu/artist/[^/?#]+/song/(?P<id>[\da-f-]+)'
```

Code after:

        return {
            'id': music_id,
            'vcodec': 'none',
            'webpage_url': webpage_url,
            'extractor_key': EggsIE.ie_key(),
            'extractor': EggsIE.IE_NAME,
            **traverse_obj(data, {
                'title': ('musicTitle', {str}),
                'url': ('musicDataPath', {url_or_none}),
                'uploader': ('artist', 'displayName', {str}),
                'uploader_id': ('artist', 'artistId', {str_or_none}),
                'thumbnail': ('imageDataPath', {url_or_none}),
                'view_count': ('numberOfMusicPlays', {int_or_none}),
                'like_count': ('numberOfLikes', {int_or_none}),
                'comment_count': ('numberOfComments', {int_or_none}),
                'composers': ('composer', {str}, all),
                'tags': ('tags', ..., {str}),
                'timestamp': ('releaseDate', {parse_iso8601}),
                'artist': ('artist', 'displayName', {str}),
            })}


class EggsIE(EggsBaseIE):
    IE_NAME = 'eggs:single'
    _VALID_URL = r'https?://eggs\.mu/artist/[^/?#]+/song/(?P<id>[\da-f-]+)'

    _TESTS = [{
        'url': 'https://eggs.mu/artist/32_sunny_girl/song/0e95fd1d-4d61-4d5b-8b18-6092c551da90',
        'info_dict': {
            'id': '0e95fd1d-4d61-4d5b-8b18-6092c551da90',
            'ext': 'm4a',
            'title': 'シネマと信号',
            'uploader': 'Sunny Girl',
            'thumbnail': r're:https?://.*\.jpg(?:\?.*)?$',
            'uploader_id': '1607',
            'like_count': int,
            'timestamp': 1731327327,
            'composers': ['橘高連太郎'],
            'view_count': int,
            'comment_count': int,
            'artists': ['Sunny Girl'],
            'upload_date': '20241111',
            'tags': ['SunnyGirl', 'シネマと信号'],
        },
    }, {
        'url': 'https://eggs.mu/artist/KAMO_3pband/song/1d4bc45f-1af6-47a9-8b30-a70cae350b4f',
        'info_dict': {
            'id': '80cLKA2wnoA',
            'ext': 'mp4',
            'title': 'KAMO「いい女だから」Audio',