codezjx / netease-cloud-music-dl

Netease cloud music song downloader, with full ID3 metadata, eg: front cover image, artist name, album name, song title and so on.
MIT License
510 stars 84 forks source link

Return {'code': -460, 'msg': 'Cheating'} #26

Closed hujy23 closed 6 years ago

hujy23 commented 6 years ago

无法下载音乐,提示Cheating

(venv) hu@NASA:~$ ncm -p http://music.163.com/#/m/playlist?id=438323195
1: Under Construction
Return {'code': -460, 'msg': 'Cheating'} when try to post {'ids': [421563589], 'br': 320000, 'csrf_token': ''} => http://music.163.com/weapi/song/enhance/player/url?csrf_token=
Traceback (most recent call last):
  File "/home/hu/Git/netease-cloud-music-dl/venv/bin/ncm", line 11, in <module>
    load_entry_point('netease-cloud-music-dl==0.2.0', 'console_scripts', 'ncm')()
  File "/home/hu/Git/netease-cloud-music-dl/venv/lib/python3.6/site-packages/netease_cloud_music_dl-0.2.0-py3.6.egg/ncm/start.py", line 76, in main
  File "/home/hu/Git/netease-cloud-music-dl/venv/lib/python3.6/site-packages/netease_cloud_music_dl-0.2.0-py3.6.egg/ncm/start.py", line 42, in download_playlist_songs
  File "/home/hu/Git/netease-cloud-music-dl/venv/lib/python3.6/site-packages/netease_cloud_music_dl-0.2.0-py3.6.egg/ncm/downloader.py", line 49, in download_song_by_song
  File "/home/hu/Git/netease-cloud-music-dl/venv/lib/python3.6/site-packages/netease_cloud_music_dl-0.2.0-py3.6.egg/ncm/api.py", line 73, in get_song_url
beterhans commented 6 years ago

Same here

hans@VUbuntu:~/source/netease-cloud-music-dl$ ncm -a 2586490 1: The Sign Return {'code': -460, 'msg': 'Cheating'} when try to post {'ids': [27114570], 'csrf_token': '', 'br': 320000} => http://music.163.com/weapi/song/enhance/player/url?csrf_token= Traceback (most recent call last): File "/usr/local/bin/ncm", line 11, in load_entry_point('netease-cloud-music-dl==0.2.0', 'console_scripts', 'ncm')() File "/usr/local/lib/python3.5/dist-packages/netease_cloud_music_dl-0.2.0-py3.5.egg/ncm/start.py", line 74, in main File "/usr/local/lib/python3.5/dist-packages/netease_cloud_music_dl-0.2.0-py3.5.egg/ncm/start.py", line 33, in download_album_songs File "/usr/local/lib/python3.5/dist-packages/netease_cloud_music_dl-0.2.0-py3.5.egg/ncm/downloader.py", line 49, in download_song_by_song File "/usr/local/lib/python3.5/dist-packages/netease_cloud_music_dl-0.2.0-py3.5.egg/ncm/api.py", line 73, in get_song_url TypeError: 'NoneType' object is not subscriptable

网易 更新了?

codezjx commented 6 years ago

对的,最近网易君的api接口有更新,做了反爬虫处理。最终发现是对Cookie里面的_ntes_nuid做了校验,目前采用随机生成_ntes_nuid的方式可以解决,参考了以下项目的方案~

https://github.com/Binaryify/NeteaseCloudMusicApi/pull/291

hujy23 commented 6 years ago

赞 ( ̄3 ̄)