]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/musicdex.py
[cleanup] Fix infodict returned fields (#8906)
[yt-dlp.git] / yt_dlp / extractor / musicdex.py
index 48f29702cf913924f441ca62a1765ddfcda74f59..a863514581982684c1e255205d4a1b2ffea77124 100644 (file)
@@ -17,11 +17,11 @@ def _return_info(self, track_json, album_json, id):
             'track_number': track_json.get('number'),
             'url': format_field(track_json, 'url', 'https://www.musicdex.org/%s'),
             'duration': track_json.get('duration'),
-            'genre': [genre.get('name') for genre in track_json.get('genres') or []],
+            'genres': [genre.get('name') for genre in track_json.get('genres') or []],
             'like_count': track_json.get('likes_count'),
             'view_count': track_json.get('plays'),
-            'artist': [artist.get('name') for artist in track_json.get('artists') or []],
-            'album_artist': [artist.get('name') for artist in album_json.get('artists') or []],
+            'artists': [artist.get('name') for artist in track_json.get('artists') or []],
+            'album_artists': [artist.get('name') for artist in album_json.get('artists') or []],
             'thumbnail': format_field(album_json, 'image', 'https://www.musicdex.org/%s'),
             'album': album_json.get('name'),
             'release_year': try_get(album_json, lambda x: date_from_str(unified_strdate(x['release_date'])).year),
@@ -43,11 +43,11 @@ class MusicdexSongIE(MusicdexBaseIE):
             'track': 'dual existence',
             'track_number': 1,
             'duration': 266000,
-            'genre': ['Anime'],
+            'genres': ['Anime'],
             'like_count': int,
             'view_count': int,
-            'artist': ['fripSide'],
-            'album_artist': ['fripSide'],
+            'artists': ['fripSide'],
+            'album_artists': ['fripSide'],
             'thumbnail': 'https://www.musicdex.org/storage/album/9iDIam1DHTVqUG4UclFIEq1WAFGXfPW4y0TtZa91.png',
             'album': 'To Aru Kagaku no Railgun T OP2 Single - dual existence',
             'release_year': 2020
@@ -69,9 +69,9 @@ class MusicdexAlbumIE(MusicdexBaseIE):
         'playlist_mincount': 28,
         'info_dict': {
             'id': '56',
-            'genre': ['OST'],
+            'genres': ['OST'],
             'view_count': int,
-            'artist': ['TENMON & Eiichiro Yanagi / minori'],
+            'artists': ['TENMON & Eiichiro Yanagi / minori'],
             'title': 'ef - a tale of memories Original Soundtrack 2 ~fortissimo~',
             'release_year': 2008,
             'thumbnail': 'https://www.musicdex.org/storage/album/2rSHkyYBYfB7sbvElpEyTMcUn6toY7AohOgJuDlE.jpg',
@@ -88,9 +88,9 @@ def _real_extract(self, url):
             'id': id,
             'title': data_json.get('name'),
             'description': data_json.get('description'),
-            'genre': [genre.get('name') for genre in data_json.get('genres') or []],
+            'genres': [genre.get('name') for genre in data_json.get('genres') or []],
             'view_count': data_json.get('plays'),
-            'artist': [artist.get('name') for artist in data_json.get('artists') or []],
+            'artists': [artist.get('name') for artist in data_json.get('artists') or []],
             'thumbnail': format_field(data_json, 'image', 'https://www.musicdex.org/%s'),
             'release_year': try_get(data_json, lambda x: date_from_str(unified_strdate(x['release_date'])).year),
             'entries': entries,