Repository: yt-dlp/yt-dlp

Issue:
[NeteaseMusic] add album info into the metadata
### DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

- [X] I understand that I will be **blocked** if I *intentionally* remove or skip any mandatory\* field

### Checklist

- [X] I'm requesting a site-specific feature
- [X] I've verified that I'm running yt-dlp version **2023.10.13** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit)
- [X] I've checked that all provided URLs are playable in a browser with the same IP and same login details
- [X] I've searched [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues **including closed ones**. DO NOT post duplicates
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)
- [X] I've read about [sharing account credentials](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#are-you-willing-to-share-account-details-if-needed) and I'm willing to share it if required

### Region

China

### Example URLs

https://music.163.com/song?id=22664748

### Provide a description that is worded well enough to be understood

Despite adding the --embed-metadata parameter, I am still unable to add album information to the metadata.

### Provide verbose output that clearly demonstrates the problem

- [X] Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
- [X] If using API, add `'verbose': True` to `YoutubeDL` params instead
- [X] Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below

### Complete Verbose Output

```shell
PS D:\WorkSpace\yt-dlp> yt-dlp -vU --embed-metadata --embed-thumbnail https://music.163.com/song?id=22664748
[debug] Command-line config: ['-vU', '--embed-metadata', '--embed-thumbnail', 'https://music.163.com/song?id=22664748']
[debug] Portable config "C:\Users\LoserFox\scoop\apps\yt-dlp\current\yt-dlp.conf": []
[debug] Encodings: locale cp936, fs utf-8, pref cp936, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2023.10.13 [b634ba742] (win_exe)
[debug] Python 3.8.10 (CPython AMD64 64bit) - Windows-10-10.0.19045-SP0 (OpenSSL 1.1.1k  25 Mar 2021)
[debug] exe versions: ffmpeg 4.2.3
[debug] Optional libraries: Cryptodome-3.19.0, brotli-1.1.0, certifi-2023.07.22, mutagen-1.47.0, sqlite3-3.35.5, websockets-11.0.3
[debug] Proxy map: {}
[debug] Loaded 1890 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Available version: stable@2023.10.13, Current version: stable@2023.10.13
Current Build Hash: 13d6a04ef6678dc61cb6e2d42eb53e69486bd2f52b8e5d778db029ccd4c600b4
yt-dlp is up to date (stable@2023.10.13)
[netease:song] Extracting URL: https://music.163.com/song?id=22664748
[netease:song] 22664748: Downloading song info
[netease:song] 22664748: Downloading song URL info: bitrate 128000
[netease:song] 22664748: Checking song URL
[netease:song] 22664748: Downloading song URL info: bitrate 192000
[netease:song] 22664748: Checking song URL
[netease:song] 22664748: Downloading song URL info: bitrate 320000
[netease:song] 22664748: Checking song URL
[netease:song] 22664748: Downloading lyrics data
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, hdr:12(7), vcodec:vp9.2(10), channels, acodec, size, br, asr, proto, vext, aext, hasaud, source, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] 22664748: Downloading 1 format(s): mMusic
[info] Downloading video thumbnail 0 ...
[info] Writing video thumbnail 0 to: グッドバイ -album version- [22664748].jpg
[debug] Invoking http downloader on "http://m801.music.126.net/20231106002121/16ce92e35c9b12afdeebedad8a24fdce/jdymusic/obj/wo3DlMOGwrbDjj7DisKw/29554583541/bd62/2ad9/3b54/07086cdc64249a8ae67ed45876bbbc35.mp3"
[debug] File locking is not supported. Proceeding without locking
[download] Destination: グッドバイ -album version- [22664748].mp3
[download] 100% of    6.49MiB in 00:00:01 at 5.16MiB/s
[Metadata] Adding metadata to "グッドバイ -album version- [22664748].mp3"
[debug] ffmpeg command line: ffmpeg -y -loglevel "repeat+info" -i "file:グッドバイ -album version- [22664748].mp3" -map 0 -dn -ignore_unknown -c copy -write_id3v1 1 -metadata "title=グッドバイ -album version-" -metadata "date=20091208" -metadata "description=[00:00.00] 作词 : toe
[00:01.00] 作曲 : toe
[01:54.70]There is no one can understand me truly / 无人能懂我 真实的我
[02:03.15]I don't go out, I will keep silence / 我不会泄露 仅仅保持沉默
[02:08.61]Everyone is mania in general / 一般而言 每个人都是狂热的
[02:13.62]You don't have / 你不必
[02:17.97]To know others / 理解旁人
[02:36.64]It's more complex than how I used to thought / 它比我曾经以为的还要复杂
[02:43.80]But already I know / 但我已经知晓
[02:46.10]The start is the end / 初始即结束
[02:50.65]Everyone is mania in general / 总的来讲 每个人都是疯狂的
[02:55.76]You don't have time to sleep / 你将没有时间休眠
[02:59.14]For to know others / 为了理解他人
[03:09.33]うまく届かないんだ… Humm / 无法顺利传达
[03:16.87]また次の不安か?… Humm / 接着感到不安
[03:23.84]A disruption and blinder… Humm / 分崩离析 视若无睹
[03:30.66]その先はないんだ… Humm / 已然没有未来
[04:48.76]うまく届かないんだ… Humm / 无法顺利传达
[04:56.60]また次の不安か?… Humm / 接着感到不安
[05:03.61]A disruption and blinder… Humm / 分崩离析 视若无睹
[05:10.48]その先は何だ… Humm / 未来会将如何" -metadata "synopsis=[00:00.00] 作词 : toe
[00:01.00] 作曲 : toe
[01:54.70]There is no one can understand me truly / 无人能懂我 真实的我
[02:03.15]I don't go out, I will keep silence / 我不会泄露 仅仅保持沉默
[02:08.61]Everyone is mania in general / 一般而言 每个人都是狂热的
[02:13.62]You don't have / 你不必
[02:17.97]To know others / 理解旁人
[02:36.64]It's more complex than how I used to thought / 它比我曾经以为的还要复杂
[02:43.80]But already I know / 但我已经知晓
[02:46.10]The start is the end / 初始即结束
[02:50.65]Everyone is mania in general / 总的来讲 每个人都是疯狂的
[02:55.76]You don't have time to sleep / 你将没有时间休眠
[02:59.14]For to know others / 为了理解他人
[03:09.33]うまく届かないんだ… Humm / 无法顺利传达
[03:16.87]また次の不安か?… Humm / 接着感到不安
[03:23.84]A disruption and blinder… Humm / 分崩离析 视若无睹
[03:30.66]その先はないんだ… Humm / 已然没有未来
[04:48.76]うまく届かないんだ… Humm / 无法顺利传达
[04:56.60]また次の不安か?… Humm / 接着感到不安
[05:03.61]A disruption and blinder… Humm / 分崩离析 视若无睹
[05:10.48]その先は何だ… Humm / 未来会将如何" -metadata "purl=https://music.163.com/song?id=22664748" -metadata "comment=https://music.163.com/song?id=22664748" -metadata "artist=toe / 土岐麻子" -movflags "+faststart" "file:グッドバイ -album version- [22664748].temp.mp3"
[EmbedThumbnail] ffmpeg: Adding thumbnail to "グッドバイ -album version- [22664748].mp3"
[debug] ffmpeg command line: ffmpeg -y -loglevel "repeat+info" -i "file:グッドバイ -album version- [22664748].mp3" -i "file:グッドバイ -album version- [22664748].jpg" -c copy -map "0:0" -map "1:0" -write_id3v1 1 -id3v2_version 3 "-metadata:s:v" "title=""Album cover""" "-metadata:s:v" "comment=Cover (front)" -movflags "+faststart" "file:グッドバイ -album version- [22664748].temp.mp3"
```



Discussion:

Resolving patch:
diff --git a/yt_dlp/extractor/neteasemusic.py b/yt_dlp/extractor/neteasemusic.py
--- a/yt_dlp/extractor/neteasemusic.py
+++ b/yt_dlp/extractor/neteasemusic.py
@@ -142,6 +142,9 @@ class NetEaseMusicIE(NetEaseMusicBaseIE):
             'subtitles': {'lyrics': [{'ext': 'lrc'}]},
             "duration": 256,
             'thumbnail': r're:^http.*\.jpg',
+            'album': '偶像练习生 表演曲目合集',
+            'average_rating': int,
+            'album_artist': '偶像练习生',
         },
     }, {
         'note': 'No lyrics.',
@@ -155,6 +158,9 @@ class NetEaseMusicIE(NetEaseMusicBaseIE):
             'timestamp': 1202745600,
             'duration': 263,
             'thumbnail': r're:^http.*\.jpg',
+            'album': 'Piano Solos Vol. 2',
+            'album_artist': 'Dustin O\'Halloran',
+            'average_rating': int,
         },
     }, {
         'url': 'https://y.music.163.com/m/song?app_version=8.8.45&id=95670&uct2=sKnvS4+0YStsWkqsPhFijw%3D%3D&dlt=0846',
@@ -171,6 +177,9 @@ class NetEaseMusicIE(NetEaseMusicBaseIE):
             'duration': 268,
             'alt_title': '伴唱:现代人乐队 合唱:总政歌舞团',
             'thumbnail': r're:^http.*\.jpg',
+            'average_rating': int,
+            'album': '红色摇滚',
+            'album_artist': '侯牧人',
         },
     }, {
         'url': 'http://music.163.com/#/song?id=32102397',
@@ -186,6 +195,9 @@ class NetEaseMusicIE(NetEaseMusicBaseIE):
             'subtitles': {'lyrics': [{'ext': 'lrc'}]},
             'duration': 199,
             'thumbnail': r're:^http.*\.jpg',
+            'album': 'Bad Blood',
+            'average_rating': int,
+            'album_artist': 'Taylor Swift',
         },
         'skip': 'Blocked outside Mainland China',
     }, {
@@ -203,6 +215,9 @@ class NetEaseMusicIE(NetEaseMusicBaseIE):
             'duration': 229,
             'alt_title': '说出愿望吧(Genie)',
             'thumbnail': r're:^http.*\.jpg',
+            'average_rating': int,
+            'album': 'Oh!',
+            'album_artist': '少女时代',
         },
         'skip': 'Blocked outside Mainland China',
     }]
@@ -253,12 +268,15 @@ def _real_extract(self, url):
             'formats': formats,
             'alt_title': '/'.join(traverse_obj(info, (('transNames', 'alias'), ...))) or None,
             'creator': ' / '.join(traverse_obj(info, ('artists', ..., 'name'))) or None,
+            'album_artist': ' / '.join(traverse_obj(info, ('album', 'artists', ..., 'name'))) or None,
             **lyric_data,
             **traverse_obj(info, {
                 'title': ('name', {str}),
                 'timestamp': ('album', 'publishTime', {self.kilo_or_none}),
                 'thumbnail': ('album', 'picUrl', {url_or_none}),
                 'duration': ('duration', {self.kilo_or_none}),
+                'album': ('album', 'name', {str}),
+                'average_rating': ('score', {int_or_none}),
             }),
         }
 


Test patch: