Skip to content

Commit

Permalink
Merge branch 'netease-radio' of https://github.com/jackyzy823/you-get
Browse files Browse the repository at this point in the history
…into jackyzy823-netease-radio
  • Loading branch information
soimort committed May 28, 2016
2 parents 82460be + 9c67f40 commit 0b3eb24
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/you_get/extractors/netease.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def netease_cloud_music_download(url, output_dir='.', merge=True, info_only=Fals
netease_lyric_download(i, l["lrc"]["lyric"], output_dir=new_dir, info_only=info_only)
except: pass

elif "song" in url:
elif "song" in url:
j = loads(get_content("http://music.163.com/api/song/detail/?id=%s&ids=[%s]&csrf_token=" % (rid, rid), headers={"Referer": "http://music.163.com/"}))
netease_song_download(j["songs"][0], output_dir=output_dir, info_only=info_only)
try: # download lyrics
Expand All @@ -70,6 +70,15 @@ def netease_cloud_music_download(url, output_dir='.', merge=True, info_only=Fals
netease_lyric_download(j["songs"][0], l["lrc"]["lyric"], output_dir=output_dir, info_only=info_only)
except: pass

elif "program" in url:
j = loads(get_content("http://music.163.com/api/dj/program/detail/?id=%s&ids=[%s]&csrf_token=" % (rid, rid), headers={"Referer": "http://music.163.com/"}))
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)

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/"}))
netease_video_download(j['data'], output_dir=output_dir, info_only=info_only)
Expand Down

0 comments on commit 0b3eb24

Please sign in to comment.