From 5f3c5a74eb75582ce92bdf8a610c4c861a4191ab Mon Sep 17 00:00:00 2001 From: BlahGeek Date: Mon, 2 May 2016 22:31:02 +0800 Subject: [PATCH 1/2] [neteasemusic] Add album info --- youtube_dl/extractor/neteasemusic.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/neteasemusic.py b/youtube_dl/extractor/neteasemusic.py index 978a05841..4023325c3 100644 --- a/youtube_dl/extractor/neteasemusic.py +++ b/youtube_dl/extractor/neteasemusic.py @@ -85,6 +85,7 @@ class NetEaseMusicIE(NetEaseMusicBaseIE): 'ext': 'mp3', 'title': 'Bad Blood (feat. Kendrick Lamar)', 'creator': 'Taylor Swift / Kendrick Lamar', + 'album': 'Bad Blood (feat. Kendrick Lamar)', 'upload_date': '20150517', 'timestamp': 1431878400, 'description': 'md5:a10a54589c2860300d02e1de821eb2ef', @@ -98,6 +99,7 @@ class NetEaseMusicIE(NetEaseMusicBaseIE): 'ext': 'mp3', 'title': '听见下雨的声音', 'creator': '周杰伦', + 'album': '哎呦,不错哦', 'upload_date': '20141225', 'timestamp': 1419523200, 'description': 'md5:a4d8d89f44656af206b7b2555c0bce6c', @@ -111,6 +113,7 @@ class NetEaseMusicIE(NetEaseMusicBaseIE): 'ext': 'mp3', 'title': 'Opus 28', 'creator': 'Dustin O\'Halloran', + 'album': 'Piano Solos Vol. 2', 'upload_date': '20080211', 'timestamp': 1202745600, }, @@ -123,6 +126,7 @@ class NetEaseMusicIE(NetEaseMusicBaseIE): 'ext': 'mp3', 'title': '소원을 말해봐 (Genie)', 'creator': '少女时代', + 'album': 'Oh!', 'description': 'md5:79d99cc560e4ca97e0c4d86800ee4184', 'upload_date': '20100127', 'timestamp': 1264608000, @@ -172,13 +176,16 @@ class NetEaseMusicIE(NetEaseMusicBaseIE): if info.get('transNames'): alt_title = '/'.join(info.get('transNames')) + album_info = info.get('album', {}) + return { 'id': song_id, 'title': info['name'], 'alt_title': alt_title, 'creator': ' / '.join([artist['name'] for artist in info.get('artists', [])]), 'timestamp': self.convert_milliseconds(info.get('album', {}).get('publishTime')), - 'thumbnail': info.get('album', {}).get('picUrl'), + 'thumbnail': album_info.get('picUrl'), + 'album': album_info.get('name'), 'duration': self.convert_milliseconds(info.get('duration', 0)), 'description': lyrics, 'formats': formats, From 1e8bb4553b28b2189318ac8aeb70224652bc39bd Mon Sep 17 00:00:00 2001 From: BlahGeek Date: Mon, 2 May 2016 22:59:06 +0800 Subject: [PATCH 2/2] [neteasemusic] Use `artist' instead of `creator' for artists of track --- youtube_dl/extractor/neteasemusic.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/youtube_dl/extractor/neteasemusic.py b/youtube_dl/extractor/neteasemusic.py index 4023325c3..6033f477a 100644 --- a/youtube_dl/extractor/neteasemusic.py +++ b/youtube_dl/extractor/neteasemusic.py @@ -84,7 +84,7 @@ class NetEaseMusicIE(NetEaseMusicBaseIE): 'id': '32102397', 'ext': 'mp3', 'title': 'Bad Blood (feat. Kendrick Lamar)', - 'creator': 'Taylor Swift / Kendrick Lamar', + 'artist': 'Taylor Swift / Kendrick Lamar', 'album': 'Bad Blood (feat. Kendrick Lamar)', 'upload_date': '20150517', 'timestamp': 1431878400, @@ -98,7 +98,7 @@ class NetEaseMusicIE(NetEaseMusicBaseIE): 'id': '29822014', 'ext': 'mp3', 'title': '听见下雨的声音', - 'creator': '周杰伦', + 'artist': '周杰伦', 'album': '哎呦,不错哦', 'upload_date': '20141225', 'timestamp': 1419523200, @@ -112,7 +112,7 @@ class NetEaseMusicIE(NetEaseMusicBaseIE): 'id': '17241424', 'ext': 'mp3', 'title': 'Opus 28', - 'creator': 'Dustin O\'Halloran', + 'artist': 'Dustin O\'Halloran', 'album': 'Piano Solos Vol. 2', 'upload_date': '20080211', 'timestamp': 1202745600, @@ -125,7 +125,7 @@ class NetEaseMusicIE(NetEaseMusicBaseIE): 'id': '22735043', 'ext': 'mp3', 'title': '소원을 말해봐 (Genie)', - 'creator': '少女时代', + 'artist': '少女时代', 'album': 'Oh!', 'description': 'md5:79d99cc560e4ca97e0c4d86800ee4184', 'upload_date': '20100127', @@ -182,7 +182,7 @@ class NetEaseMusicIE(NetEaseMusicBaseIE): 'id': song_id, 'title': info['name'], 'alt_title': alt_title, - 'creator': ' / '.join([artist['name'] for artist in info.get('artists', [])]), + 'artist': ' / '.join([artist['name'] for artist in info.get('artists', [])]), 'timestamp': self.convert_milliseconds(info.get('album', {}).get('publishTime')), 'thumbnail': album_info.get('picUrl'), 'album': album_info.get('name'), @@ -327,7 +327,7 @@ class NetEaseMusicMvIE(NetEaseMusicBaseIE): 'ext': 'mp4', 'title': '이럴거면 그러지말지', 'description': '白雅言自作曲唱甜蜜爱情', - 'creator': '白雅言', + 'artist': '白雅言', 'upload_date': '20150520', }, 'skip': 'Blocked outside Mainland China', @@ -350,7 +350,7 @@ class NetEaseMusicMvIE(NetEaseMusicBaseIE): 'id': mv_id, 'title': info['name'], 'description': info.get('desc') or info.get('briefDesc'), - 'creator': info['artistName'], + 'artist': info['artistName'], 'upload_date': info['publishTime'].replace('-', ''), 'formats': formats, 'thumbnail': info.get('cover'),