V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
wuyoudehe
V2EX  ›  Python

网易云我的歌单怎么获取 ?

  •  
  •   wuyoudehe · 2017-08-22 23:01:59 +08:00 · 3144 次点击
    这是一个创建于 2410 天前的主题,其中的信息可能已经有所发展或是发生改变。
    分析 POST 数据什么的都发现未登录请求头带了个 csrf_token,,登录后这个又莫名奇妙变成另外一个并储存在 cookie 中
    请求链接: http://music.163.com/weapi/v3/playlist/detail?csrf_token=c7e8af0fe539887defb2f22d9b9523d2 然后返回个 json 求告知这个 token 怎么解决。。谢谢
    8 条回复    2017-08-23 09:26:25 +08:00
    eoo
        1
    eoo  
       2017-08-23 00:27:32 +08:00 via Android   ❤️ 1
    csrf_token 难道不是从 COOKIE 中取得?
    ysc3839
        2
    ysc3839  
       2017-08-23 00:28:49 +08:00   ❤️ 1
    好像并不需要呀,网页版的歌单,如 https://music.163.com/playlist?id=889570491 里面可以直接获取到 JSON 数据。
    skylancer
        3
    skylancer  
       2017-08-23 01:42:35 +08:00   ❤️ 1
    你点下分享歌单,然后你就懂了
    wuyoudehe
        5
    wuyoudehe  
    OP
       2017-08-23 07:18:40 +08:00
    @skylancer 确实可以,就怕 url:前面 2 数字会变
    wuyoudehe
        6
    wuyoudehe  
    OP
       2017-08-23 07:20:08 +08:00
    @crab 谢谢大神,,这么难的加密都能弄出来,,,,
    a2316155
        7
    a2316155  
       2017-08-23 09:16:57 +08:00   ❤️ 1
    之前很想爬歌单。。搞了半天找不到请求方式。。最后很蠢的用 selenium+plantomjs 抓的。。
    homelajiang
        8
    homelajiang  
       2017-08-23 09:26:25 +08:00   ❤️ 1
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1419 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 17:26 · PVG 01:26 · LAX 10:26 · JFK 13:26
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.