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

获取高于128的播放链接失败,设置好QQ音乐会员的cookie也不行 #49

Open
qweiop12300 opened this issue Jun 13, 2021 · 6 comments

Comments

@qweiop12300
Copy link

环境

系统:

nodejs 版本(koa2要求版本是7.6.0+):

出现问题

重现步骤

期待效果

重现步骤尽量详细,不能含糊不清

如果不是提建议,提 issues 如果不照着模版来将不会优先处理或直接关闭

@Rain120
Copy link
Owner

Rain120 commented Jun 20, 2021

@qweiop12300
是不是 QQ 音乐限制了,我没有 QQ 会员,没有测试过这种场景
可以协助或者帮忙 PR 下吗?谢谢

@qweiop12300
Copy link
Author

@qweiop12300
是不是QQ音乐限制了,我没有QQ会员,没有
经历过这种场景可以帮忙或者帮忙公关下吗?谢谢
抱歉哈,还在学习中,只会写点android,昨天提交的是修复好了嘛

@dipelta
Copy link

dipelta commented May 11, 2022

module/apis/u_common.js中的请求头中没有设置cookie,导致了在user-info.js中设置的QQ音乐会员cookie无效
修复这个问题只需要在headers对象中添加对应的cookie属性和值即可
引入cookie的配置文件const userInfoConfig = require('../../config/user-info');
然后在headers中添加'cookie': userInfoConfig.userInfo.cookie,

const request = require('../../util/request');
const config = require('../config');
const userInfoConfig = require('../../config/user-info');

module.exports = ({ options = {}, method = 'get' }) => {
	let opts = Object.assign(options, config.commonParams, {
		headers: {
			referer: 'https://y.qq.com/portal/player.html',
			host: 'u.y.qq.com',
			'content-type': 'application/x-www-form-urlencoded',
			'cookie': userInfoConfig.userInfo.cookie,
		},
	});
	console.log('https://u.y.qq.com/cgi-bin/musicu.fcg', {opts})
	return request('https://u.y.qq.com/cgi-bin/musicu.fcg', method, opts, 'u');
};

另外发现不能无脑的复制浏览器中的cookie值,我在测试过程中看到cookie中有key为sensorsdata2015jssdkcross的数据,需要将这个cookie进行删除,否则服务启动后所有接口均会报错
image
image

Rain120 added a commit that referenced this issue Aug 15, 2022
* fix: cookies not cache, just overwrite it, #49

* chore: remove useless console
@VCE-K
Copy link

VCE-K commented May 15, 2023

大佬们,有遇到过http://localhost:3200/getMusicPlay?songmid=0025NhlN2yWrP4获取歌曲播放地址接口调用返回暂无播放链接的错误吗?能指点小弟下迷津吗,我不知道是QQ音乐做限制还是我本身问题

@qweiop12300
Copy link
Author

大佬们,有遇到过http:// localhost:3200/getMusicPlay?songmid=0025NhlN2yWrP4获取歌曲播放地址接口使用返回暂时无播放链接的错误吗?指点小弟下迷津吗,我不知道是QQ音乐做的限制还是我自己的问题

好久没用了,是不是获取频繁?我之前获取频繁的时候qq音乐也会有限制。

@VCE-K
Copy link

VCE-K commented May 15, 2023 via email

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

4 participants