Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

收费歌曲无法获取播放地址,在哪里设置cookie呢? #8

Closed
Apibug opened this issue Jan 2, 2020 · 14 comments
Closed

Comments

@Apibug
Copy link

Apibug commented Jan 2, 2020

{
"result": 400,
"errMsg": "获取播放链接出错"
}

@jsososo
Copy link
Owner

jsososo commented Jan 3, 2020

img

可以参照这里,用post请求,url 为 #/user/setQCookieapplication/json ,请求内容为 {"data":"你的cookie"}

@Apibug
Copy link
Author

Apibug commented Jan 3, 2020

搞好了,谢谢dalao

@Apibug
Copy link
Author

Apibug commented Jan 3, 2020

cookie已经弄好了,获取无损音质以及下载链接都可以获取到,就是song/urls?id=0039MnYb0qxYhV,004Z8Ihr0JIu5s
还是获取不到
{
"result": 400,
"errMsg": "获取播放链接出错"
}

@jsososo
Copy link
Owner

jsososo commented Jan 3, 2020

url 对的嘛,https://api.qq.jsososo.com/song/urls?id=0039MnYb0qxYhV,004Z8Ihr0JIu5s 这个接口我这边试了一下是可以的,你这个报错应该只出现在 /song/url 接口,不是 /song/urls接口,前者只能获取单个,但可以获取各种格式,后者只能获取m4a 格式,但可以批量获取

@Apibug
Copy link
Author

Apibug commented Jan 3, 2020

应该不是不可以批量获取的问题,是/song/urls好像只是获取不到会员歌曲:
http://qqmusic.w0ai1uo.org/song/urls?id=0039MnYb0qxYhV,004Z8Ihr0JIu5s,000W9VJm3sMSJU,000SKW960FXmxr
这是我直接clone项目过来的,不应该呀

@jsososo
Copy link
Owner

jsososo commented Jan 3, 2020

这个其实是要看账号cookie的,如果是会员的账号用这个接口是能获取到会员歌曲链接的,另外像有些必须付费收听的也是一定要这个账号买了才能获取到,但是另外的单个获取的接口貌似不需要会员

@Apibug
Copy link
Author

Apibug commented Jan 3, 2020

但是我post请求设置了cookie了,是会员账号呀
{
"result": 100,
"data": "操作成功"
}
就是会员的获取不到歌曲链接

@jsososo
Copy link
Owner

jsososo commented Jan 3, 2020

更新一下 cookie 试试?或者我的接你看看
pgv_pvid=3661080646; ts_uid=1405531576; pgv_pvi=6255642624; RK=tGhAJrFZO2; ptcz=32d501823bf0ce457005d872e92673dc307726d91d6f58a125d222698c6efff9; psrf_qqrefresh_token=25BACF1650EE2592D06BCC19EEAD7AD6; psrf_qqopenid=239ACC14853AA1038A3A539429D0AC48; psrf_qqaccess_token=6B0C62126368CA1ACE16C932C679747D; psrf_qqunionid=B727DBE86225939A050C84A13D0A3A05; p_luin=o0956581739; p_lskey=00040000897aec6db8fcb126c0b548a4559f83cb0f222fcc2af7991c202d940171ab0c5dd09c2c1f5b468755; o_cookie=956581739; ts_refer=ADTAGmyqq; tvfe_boss_uuid=8cb52e642c3305d2; uin=956581739; yq_index=4; pgv_info=ssid=s8680471336; pgv_si=s9410158592; yqq_stat=0; ts_last=y.qq.com/; qm_keyst=Q_H_L_28W1Fu50ey5NdnhKraomG7otjKfuRK1slzBwDCO8Yi3MvE8s_TC76YrswUuT3T1; psrf_access_token_expiresAt=1585818882; psrf_musickey_createtime=1578042882; userAction=1
这里返回的操作成功只负责把cookie存到 node,是不做任何校验什么的

@Apibug
Copy link
Author

Apibug commented Jan 3, 2020

用了你的可以了诶,我取的cookie跟你的有差异
pgv_pvi=9917477888; RK=hSqoxv64Ff; ptcz=e21960e293389de70e2830070ea6459006c15b8c9fdda0d354d09e777e1eb9de; pgv_pvid=7369289994; ts_uid=571052904; userAction=1; pgv_info=ssid=s4535523016; pgv_si=s2626076672; ptui_loginuin=753138806; ts_refer=i.y.qq.com/n2/m/share/details/taoge.html; psrf_qqrefresh_token=DB491D863E1635C436CD5625086B84FB; psrf_qqaccess_token=DCE49C49686FBA5C7B55269E8A1CE457; psrf_qqopenid=5C505AA81FEC3C35ECB9685911A05835; psrf_qqunionid=9B14041C40A7446B0FD3C3684CF05ACF; yq_playschange=0; yq_playdata=; player_exist=1; yq_index=0; qqmusic_fromtag=66; yplayer_open=0; skey=@r32ZRrXOX; yqq_stat=0; ts_last=y.qq.com/; psrf_access_token_expiresAt=1585813998; uin=753138806; psrf_musickey_createtime=1578037998; qm_keyst=Q_H_L_2ukyEu50ea-Z6Lqf3rPsVQYdpYPN6GhpQxUXx3x1Nqau_cbTpIaNSShwl5VL21A

@jsososo
Copy link
Owner

jsososo commented Jan 3, 2020

额,你的cookie好像确实不行,说实话我也不太清楚是哪里的问题,我都是直接在网页版登陆之后复制 document.cookie里的内容

@Apibug
Copy link
Author

Apibug commented Jan 3, 2020

我是在chrome里console里复制的document.cookie内容,dalao你用的什么呀,我试了几次还是不行

@jsososo
Copy link
Owner

jsososo commented Jan 3, 2020

额,我也是一样的

@Apibug
Copy link
Author

Apibug commented Jan 3, 2020

真是奇了怪呀,我豪华绿钻年费贵族lv8+豪华音乐包年费贵族lv7。
cookie都有毛病

@jsososo
Copy link
Owner

jsososo commented Mar 22, 2020

因为 cookie 中的 uin 包含了一些多余字母,参考 #17 已修复

@jsososo jsososo closed this as completed Mar 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants