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

错误代码 -460 “网络太拥挤,请稍候再试” #58

Closed aisuneko closed 3 years ago

aisuneko commented 3 years ago
Return {'code': -460, 'message': '网络太拥挤,请稍候再试!'} when try to post {'ids': [40729218], 'br': 320000, 'csrf_token': ''} => http://music.163.com/weapi/song/enhance/player/url?csrf_token=
Traceback (most recent call last):
  File "/usr/local/bin/ncm", line 33, in <module>
    sys.exit(load_entry_point('netease-cloud-music-dl==0.2.0', 'console_scripts', 'ncm')())
  File "/usr/local/lib/python3.7/dist-packages/netease_cloud_music_dl-0.2.0-py3.7.egg/ncm/start.py", line 69, in main
  File "/usr/local/lib/python3.7/dist-packages/netease_cloud_music_dl-0.2.0-py3.7.egg/ncm/downloader.py", line 22, in download_song_by_id
  File "/usr/local/lib/python3.7/dist-packages/netease_cloud_music_dl-0.2.0-py3.7.egg/ncm/downloader.py", line 54, in download_song_by_song
  File "/usr/local/lib/python3.7/dist-packages/netease_cloud_music_dl-0.2.0-py3.7.egg/ncm/api.py", line 73, in get_song_url
TypeError: 'NoneType' object is not subscriptable
AllanChain commented 3 years ago

ncm/constants.py 中将 User-Agent 改为 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 等浏览器的 UA 即可。可能是 163 反爬的问题。希望 @codezjx 能够修复一下。

codezjx commented 3 years ago

感谢@aisuneko 反馈的问题和@AllanChain 提供的思路~ 已修复