V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
fatears
V2EX  ›  PHP

有办法输出网易云音乐用户的歌单么?

  •  
  •   fatears · 2016-01-28 17:46:09 +08:00 · 4533 次点击
    这是一个创建于 3016 天前的主题,其中的信息可能已经有所发展或是发生改变。

    我用的是 http://music.163.com/api/user/playlist/?offset=0&limit=1001&uid=这个 api ,输出{"message":"illegal request!","code":403},需要设置什么 header 头?

    2 条回复    2017-06-22 14:44:32 +08:00
    Goooogle
        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
    navk
        2
    navk  
       2017-06-22 14:44:32 +08:00
    设置请求头好像并没有什么用。 @fatears 解决了吗。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1037 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 23:44 · PVG 07:44 · LAX 16:44 · JFK 19:44
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.