mirror of
https://github.com/soimort/you-get.git
synced 2025-01-23 13:35:16 +03:00
[netease]: Add pagination on netease radio
This commit is contained in:
parent
af3468fa05
commit
023d12fa2d
@ -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/"}))
|
||||
|
Loading…
Reference in New Issue
Block a user