我用的是 http://music.163.com/api/user/playlist/?offset=0&limit=1001&uid=这个 api ,输出{"message":"illegal request!","code":403},需要设置什么 header 头?
1
Goooogle 2016-01-29 00:01:39 +08:00 via Android
self.header = {
'Accept': '*/*', 'Accept-Encoding': 'gzip,deflate,sdch', 'Accept-Language': 'zh-CN,zh;q=0.8,gl;q=0.6,zh-TW;q=0.4', 'Connection': 'keep-alive', 'Content-Type': 'application/x-www-form-urlencoded', 'Host': 'music.163.com', 'Referer': 'http://music.163.com/search/', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.152 Safari/537.36' } 可以参考 https://github.com/wu-nerd/dmusic-plugin-NeteaseCloudMusic/blob/master/neteasecloudmusic/netease_api.py |