diff --git a/src/you_get/extractors/netease.py b/src/you_get/extractors/netease.py index ca1be887..48e6dc53 100644 --- a/src/you_get/extractors/netease.py +++ b/src/you_get/extractors/netease.py @@ -79,9 +79,14 @@ def netease_cloud_music_download(url, output_dir='.', merge=True, info_only=Fals netease_song_download(j["program"]["mainSong"], output_dir=output_dir, info_only=info_only) elif "radio" in url: - j = loads(get_content("http://music.163.com/api/dj/program/byradio/?radioId=%s&ids=[%s]&csrf_token=" % (rid, rid), headers={"Referer": "http://music.163.com/"})) - for i in j['programs']: - netease_song_download(i["mainSong"],output_dir=output_dir, info_only=info_only) + offset = 0 + while True: + j = loads(get_content("http://music.163.com/api/dj/program/byradio/?radioId=%s&ids=[%s]&csrf_token=&offset=%d" % (rid, rid, offset), headers={"Referer": "http://music.163.com/"})) + for i in j['programs']: + netease_song_download(i["mainSong"], output_dir=output_dir, info_only=info_only) + if not j['more']: + break + offset += len(j['programs']) elif "mv" in url: j = loads(get_content("http://music.163.com/api/mv/detail/?id=%s&ids=[%s]&csrf_token=" % (rid, rid), headers={"Referer": "http://music.163.com/"}))