From 16e75a06b2b84fb9eef5b83fd72fdd9f0c3a04f0 Mon Sep 17 00:00:00 2001 From: Gilles Filippini Date: Mon, 1 Jun 2015 18:59:55 +0200 Subject: [PATCH] Fix case when hMusic data is None This occurs for example with these urls: http://music.163.com/song?id=17699228 http://music.163.com/song?id=17699232 --- src/you_get/extractors/netease.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/you_get/extractors/netease.py b/src/you_get/extractors/netease.py index a0a3824d..7ef90899 100644 --- a/src/you_get/extractors/netease.py +++ b/src/you_get/extractors/netease.py @@ -48,7 +48,7 @@ def netease_cloud_music_download(url, output_dir='.', merge=True, info_only=Fals def netease_song_download(song, output_dir='.', info_only=False): title = "%s. %s" % (song['position'], song['name']) - if 'hMusic' in song: + if 'hMusic' in song and song['hMusic'] != None: url_best = make_url(song['hMusic']['dfsId']) elif 'mp3Url' in song: url_best = song['mp3Url']