From 9d4f213f90d6024c7748f4defdc7b45f2351b0da Mon Sep 17 00:00:00 2001 From: Yen Chi Hsuan Date: Fri, 5 Jun 2015 00:52:18 +0800 Subject: [PATCH] [qqmusic:toplist] List name and description are optional --- youtube_dl/extractor/qqmusic.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/youtube_dl/extractor/qqmusic.py b/youtube_dl/extractor/qqmusic.py index 9943fcddb..f773332a8 100644 --- a/youtube_dl/extractor/qqmusic.py +++ b/youtube_dl/extractor/qqmusic.py @@ -222,6 +222,7 @@ def _real_extract(self, url): ) for song in toplist_json['songlist'] ] - list_name = toplist_json['topinfo']['ListName'] - list_description = toplist_json['topinfo']['info'] + topinfo = toplist_json.get('topinfo', {}) + list_name = topinfo.get('ListName') + list_description = topinfo.get('info') return self.playlist_result(entries, list_id, list_name, list_description)