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

Code before:
            'upload_date': '20251010',
            'modified_timestamp': 1760624868,
            'modified_date': '20251016',
            'tags': ['recommended', 'recent-release'],
        },
        'playlist_count': 7,
    }]
    _API_URL_TMPL = 'https://api.idagio.com/v2.0/metadata/albums/{}'
    _PLAYLIST_ID_KEY = 'display_id'

    def _parse_playlist_metadata(self, playlist_info):
        return traverse_obj(playlist_info, {
            'id': ('id', {str}),
            'title': ('title', {str}),
            'timestamp': ('publishDate', {unified_timestamp}),
            'modified_timestamp': ('lastModified', {unified_timestamp}),
            'thumbnail': ('imageUrl', {url_or_none}),
            'description': ('description', {str}),
            'artists': ('participants', ..., 'name', {str}),
            'tags': ('tags', ..., {str}),
        })


class IdagioPlaylistIE(IdagioPlaylistBaseIE):
    _VALID_URL = r'https?://(?:www\.)?app\.idagio\.com(?:/[a-z]+)?/playlists/(?!personal/)(?P<id>[\w-]+)'
    _TESTS = [{
        'url': 'https://app.idagio.com/playlists/beethoven-the-most-beautiful-piano-music',
        'info_dict': {
            'id': '31652bec-8c5b-460e-a3f0-cf1f69817f53',
            'display_id': 'beethoven-the-most-beautiful-piano-music',
            'title': 'Beethoven: the most beautiful piano music',
            'description': 'md5:d41bb04b8896bb69377f5c2cd9345ad1',
            'thumbnail': r're:https://.+/playlists/31652bec-8c5b-460e-a3f0-cf1f69817f53/main\.jpg',
            'creators': ['IDAGIO'],
        },
        'playlist_mincount': 16,  # one entry is geo-restricted
    }]
    _API_URL_TMPL = 'https://api.idagio.com/v2.0/playlists/{}'
    _PLAYLIST_ID_KEY = 'display_id'

    def _parse_playlist_metadata(self, playlist_info):
        return traverse_obj(playlist_info, {
            'id': ('id', {str}),
            'title': ('title', {str}),
            'thumbnail': ('imageUrl', {url_or_none}),
            'description': ('description', {str}),
            'creators': ('curator', 'name', {str}, all),
        })


class IdagioPersonalPlaylistIE(IdagioPlaylistBaseIE):

Review comment (suggestion):
```suggestion
    _VALID_URL = r'https?://(?:www\.)?app\.idagio\.com(?:/[a-z]{2})?/playlists/(?!personal/)(?P<id>[\w-]+)'
    _TESTS = [{
```
again, add `only_matching` test please

Code after:
            'thumbnail': r're:https://.+/albums/3149020954522/main\.jpg',
            'artists': ['Sabine Devieilhe', 'Stéphane Degout', 'Raphaël Pichon', 'Pygmalion', 'Johannes Brahms'],
            'timestamp': 1760054400,
            'upload_date': '20251010',
            'modified_timestamp': 1760624868,
            'modified_date': '20251016',
            'tags': ['recommended', 'recent-release'],
        },
        'playlist_count': 7,
    }]
    _API_URL_TMPL = 'https://api.idagio.com/v2.0/metadata/albums/{}'
    _PLAYLIST_ID_KEY = 'display_id'

    def _parse_playlist_metadata(self, playlist_info):
        return traverse_obj(playlist_info, {
            'id': ('id', {str}),
            'title': ('title', {str}),
            'timestamp': ('publishDate', {unified_timestamp}),
            'modified_timestamp': ('lastModified', {unified_timestamp}),
            'thumbnail': ('imageUrl', {url_or_none}),
            'description': ('description', {str}),
            'artists': ('participants', ..., 'name', {str}),
            'tags': ('tags', ..., {str}),
        })


class IdagioPlaylistIE(IdagioPlaylistBaseIE):
    _VALID_URL = r'https?://(?:www\.)?app\.idagio\.com(?:/[a-z]{2})?/playlists/(?!personal/)(?P<id>[\w-]+)'
    _TESTS = [{
        'url': 'https://app.idagio.com/playlists/beethoven-the-most-beautiful-piano-music',
        'info_dict': {
            'id': '31652bec-8c5b-460e-a3f0-cf1f69817f53',
            'display_id': 'beethoven-the-most-beautiful-piano-music',
            'title': 'Beethoven: the most beautiful piano music',
            'description': 'md5:d41bb04b8896bb69377f5c2cd9345ad1',
            'thumbnail': r're:https://.+/playlists/31652bec-8c5b-460e-a3f0-cf1f69817f53/main\.jpg',
            'creators': ['IDAGIO'],
        },
        'playlist_mincount': 16,  # one entry is geo-restricted
    }, {
        'url': 'https://app.idagio.com/de/playlists/piano-music-for-an-autumn-day',
        'info_dict': {
            'id': 'd70e9c7f-7080-4308-ae0f-f890dddeda82',
            'display_id': 'piano-music-for-an-autumn-day',
            'title': 'Piano Music for an Autumn Day',
            'description': 'Get ready to snuggle up and enjoy all the musical colours of this cosy, autumnal playlist.',
            'thumbnail': r're:https://.+/playlists/d70e9c7f-7080-4308-ae0f-f890dddeda82/main\.jpg',
            'creators': ['IDAGIO'],
        },
        'playlist_count': 35,
    }]