jsososo / qqmusicapi Goto Github PK
View Code? Open in Web Editor NEW基于 Express + Axios 的 QQ音乐接口 nodejs 版
Home Page: https://api.qq.jsososo.com
License: GNU General Public License v3.0
基于 Express + Axios 的 QQ音乐接口 nodejs 版
Home Page: https://api.qq.jsososo.com
License: GNU General Public License v3.0
RT,本地就算设置完 cookie 后 /user/detail 还是会报 301 错误,更新 cookie 后也是这样
有没有方法可以下载无损音质的音乐
/song/url?id=000zEdAk359qlo
返回{"result":400,"errMsg":"获取播放链接出错"}
是无法请求到资源嘛...
/(ㄒoㄒ)/~~
song.js在235行写错了rest api的名称 ,应该是post不是get
对node.js不是很了解,只会点php,请教一下哪个文件里存放cookie,谢谢作者
调用下载接口出问题,无法返回音乐下载链接,但是歌曲信息接口还是可以正常调用。
大佬您好
我在部署您的QQ音乐的API node
在获取播放地址的时候出现
GET /song/urls?id=0039MnYb0qxYhV,004Z8Ihr0JIu5s - - ms - - (node:19428) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'data' of undefined at reqFun (C:\Users\xiaou\Desktop\QQMusicApi-master\routes\song.js:146:22) at process._tickCallback (internal/process/next_tick.js:68:7) (node:19428) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2) GET /song/urls?id=0039MnYb0qxYhV,004Z8Ihr0JIu5s - - ms - -
如果您有空希望告知一下是什么问题
http://localhost:3300/top/category
我这样请求不到数据
我用的8.12 安装好之后 无法获取到播放地址 返回的data是空的
使用
"https://y.gtimg.cn/music/photo_new/T002R300x300M000" + mid
按照文档将 mid 改好后接口返回404了
你是不是接口访问次数太多了
规则是什么
虽然浏览器用cookie就可以正确获取页面,但是用request不行
/song/url seems doesn't work any more, can you confirm
用/song/url返回的总是400错误
用/song/urls直接就报错
(node:4660) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'data' of undefined
at reqFun (C:\Program\QQMusicApi\routes\song.js:146:22)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async getUrls (C:\Program\QQMusicApi\routes\song.js:152:5)
(node:4660) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)
想问问到底是什么问题
您好,首选感谢您的开源分享。有个问题想请教一下,我看源码里面有一个使用POST方法在body中传入cookie的方式来设置全局的cookie,我用PostMan试着传入了QQ音乐的cookie的值,但是每次都会返回
TypeError: Cannot read property 'split' of undefined at router.post (/root/git/QQMusicApi/routes/user.js:18:8)应该是传入的参数格式有问题,所以想请问一下,在body中传入的格式是什么样的呀(这方面我接触的少,不太懂,勿见怪) 我在传参的时候是这么做的 : 在body中添加: pgv_pvid=XXXX; ts_uid=XXXX ...
我是通过 https://y.qq.com/ 登录 qq 来获取 cookies 的。对于获取音频链接,qqmusic_key
应该是关键,但是这个值只有一天的有效性,过期后无法再获取 flac 的链接。
请问我该如何自动更新 cookies,而不需要每天都登录一次再手动添加 cookies。
是不是直接把文件解压到网站后台就可以了 , 还要配置一些什么文件或安装什么吗?
您好,非常棒的项目!
但是我发现/song这一接口的扩展性不是很好,不能批量获得多个mid的歌曲信息。请问能否完善此接口?十分感谢!
可以不统计他人IP不,容易暴露别人的IP在网上呀
问题已解决
我写的程序的下载功能需要连续请求多次下载链接,但是会被拉黑
请求参数:
pageNo 应该是页码
pageSize 应该才是每页条数
返回参数:
rankType:4 代表新歌
关键词: 如寄 - 萧忆情Alex
https://api.qq.jsososo.com/song/find?key=%E5%A6%82%E5%AF%84%20-%20%E8%90%A7%E5%BF%86%E6%83%85Alex
得到songmid = 0001bB2k2wPvxW
后
https://api.qq.jsososo.com/song/urls?id=0001bB2k2wPvxW 返回的歌曲网址可正常播放
https://api.qq.jsososo.com/song/url?id=0001bB2k2wPvxW 返回的歌曲网址下载时回应404
RT,部署在Leancloud上提示[2020-07-14T05:06:00.718Z][system] 部署失败:ER_TRUNCATED_WRONG_VALUE_FOR_FIELD: Incorrect string value: '\xF0\x9F\x8D\x91 \xE8...' for column 'comment' at row 1
我粗略的阅读了您的代码, 发现代码质量非常好, 对于几个地方,我有些疑问, 或者说也算是建议吧
1. 每次运行npm start的时候都会输出node ./bin/www
, 然后就没有了. 这样开发者也许不知道服务器初始化完成了没有. 我觉得如果在'debug('Listening on ' + bind);
' 后面加上 console.log("server is running on ", addr.port)
会更好.每次初始化完成都会打印监听的端口号,这样开发者既能知道服务器初始化完成,可以访问了,也能提示当前监听的端口
2. 关于logger, 我看用到了const logger = require('morgan')
, 但是这日志仅是
HTTP request logger middleware for node.js
如果开发或运维想查看服务器的运行log文件的话, 比如,检查服务器的响应结果,或者服务器运行过程中有没有报错等
3. 关于
dataHandle[func](ip, type);
res.send({
result: 100,
data: '就当成功了吧',
})
我觉得写一个回调给dataHandle, 在回调里运行'就当成功了
吧'可能会更严谨.
4. 文中多次出现类似这种连环取属性的操作result.gedan.data.vec_gedan
, 严格意义上来讲是不严谨, 正确的写法应该是
if(result && result.gedan && result.gedan.data && result.gedan.data.vec_gedan ){ ... } else { console.log('give some tips') }
当然,我们可以写一个函数来判断对象是否具有这些多层属性
5. 最后一点, 是我个人的编程军规: feedback.js
line 19
我是很反对这种写法的console.log(val, this.data);
, 因为当别人看到这条log的时候,不知道这条log是什么意思,,只能看到变量的结果. 规范的写法应该是console.log('feedback add val', val, "this.data", this.data);
, 这样的话,别人看到就知道这条log是feedback文件里的,在add方法里,打印的两个变量的含义分别是value
和this.data
. 尤其是在日志文件里检查log,非常有用
在下才疏学浅,没有过多研究和调试,如有误解,欢迎指正
问题还原:
在我配置完并传入Cookie后,并没有像预料的那样获取到付费歌曲以及无损音质,在我细(暴)心(怒)排查后,发现我的Cookie里面uin一项也就是QQ号,神奇的在前面多了一个字母 “o” 。
好的,找到问题,接下来就好办了,用postman手动post自己修改后(去掉字母 “o” )的Cookie,再测试就已经完美运行了,奈斯。
目前并不清楚是不是只有我个人出现了这个问题,貌似作者和其他使用者都挺正常的。
接口:/mv/list默认都是显示最新的mv,希望增加一个显示最多播放mv的功能
比如给一个参数isRedirect
/song/url?id=002Nn2nE0Hu7WM&isRedirect=1
在请求时当isRedirect=1时重定向到歌曲的下载链接
请求/song/url?id=mid&isRedirect=1 =>判断当isRedirect=1 => 重定向到歌曲下载链接
QQ:2657131897 @jsososo
你好,今天我在尝试安装你的api服务,但是装不上,能帮忙看下么,非常感谢
` [email protected] start /root/QQMusicApi
node ./bin/www
/root/QQMusicApi/app.js:51
...req.query,
^^^
SyntaxError: Unexpected token ...
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object. (/root/QQMusicApi/bin/www:7:11)
npm ERR! Linux 3.10.0-1062.4.1.el7.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "start"
npm ERR! node v6.17.1
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: node ./bin/www
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node ./bin/www'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the qqmusicapi package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node ./bin/www
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs qqmusicapi
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls qqmusicapi
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /root/QQMusicApi/npm-debug.log`
POST提示
{"result":400,"errMsg":"自己起一个 node 服务 这么难???"}
我是在自己的服务器上搭建的
有吗?
不太懂node和服务器这块的,见谅,查了不少资料,node js 开启https服务,需要域名、服务器、SSL证书,这些我都有,想请问一下,如何在你这个项目中开启https服务呢?
我看你的这个测试网址也是支持https请求的,所以想请教一下,你的https是在项目中设置的嘛?需要在项目中配置什么呢? 谢谢啦
因为有些无损返回的链接是404,然后我看了一下代码,在获取vkey时 filename
用的是 mid
,而不是 media_mid
,所以返回的链接是404,比如这首歌:https://api.qq.jsososo.com/song/url?id=003u9Xfg0KLHNF&type=flac
应该先通过 https://c.y.qq.com/v8/fcg-bin/fcg_play_single_song.fcg?songmid=003u9Xfg0KLHNF&platform=yqq&format=json 获取 media_mid
,再用 media_mid
拼出 filename
才能获取到正确的vkey。
完整拼接:http://c.y.qq.com/base/fcgi-bin/fcg_music_express_mobile3.fcg?g_tk=1722049047&loginUin=956581739&needNewCode=0&cid=205361747&uin=323&songmid=003u9Xfg0KLHNF&filename=F000002pcmA1DrDOG.flac&guid=999
这里 songmid=003u9Xfg0KLHNF,filename=F000002pcmA1DrDOG.flac
不知道我表述的是否清楚哈
{
"result": 400,
"errMsg": "获取播放链接出错"
}
承蒙各位的喜欢,最近网站的uv与之前相比有了巨大的提升,同时也带来了非常大的服务器负载和流量开销,后续可能会慢慢缩紧高频ip的限制、其他应用对示例接口访问甚至是对示例网站的测试接口进行限流,也非常希望喜欢这个项目的同学可以自行git clone 搭建 node 项目。
👍
这个版本很棒,想问下有没有原始请求接口,想改造成其他语言的
在用户歌单里 没有找到 “我喜欢” 的这个歌单 只能看到自建歌单
歌单查询长时间无响应
请告知 如何设置
现在的 /singer/songs
好像只能获取 30 首歌曲
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.