网易云音乐接口
npm i
node app.js或者pm2 forever之类启动
直接访问服务器地址 如http://localhost:3000/v1/fm //fm电台
欢迎star issue
网易云音乐接口
网易云音乐接口
npm i
node app.js或者pm2 forever之类启动
直接访问服务器地址 如http://localhost:3000/v1/fm //fm电台
欢迎star issue
前后端部署成功后,会发现前端页面获取后端数据时,会出现跨域问题。翻阅服务端的代码,是可以看到是有处理跨域的(header.set('Access-Control-Allow-Origin', '*')),但是并没有生效。
解决跨域问题的几种常规方式:后端header加跨域设置(没生效),前端使用代理(开发环境有效,生产环境无效),使用nginx代理(生产、开发环境都可以)。
出于仅仅研究项目的目的,此处采用前端代理的方式,如下:
打开前端neteasemusic/src/main.js文件,做出以下修改
//axios.defaults.baseURL = 'http://localhost:3000/v1/';
axios.defaults.baseURL = '/api';
打开前端neteasemusic/config/index.js文件,做出以下修改
proxyTable: {
"/api": {
target: "http://localhost:3000/v1/", //设置你调用的接口域名和端口号
changeOrigin: true, //跨域
pathRewrite: {
"^/api": "/"
}
}
}
最后,重启前端项目就行了,跨域问题解决了。
当我访问http://localhost:3000/v1/music/url?id=1045123?br=9999 的时候,返回了这样的回复:
{
"code": -460,
"msg": "Cheating"
}
我输入的账号密码都没有问题,但是接口返回的数据是 {msg:"非法的登录请求!",code:400}
,不知道问题出在哪里?
var id = parseInt(request.query.id);
var data = {
"id": id,
'c': JSON.stringify([{ id: id }]),
"ids": '[' + id + ']',
"csrf_token": ""
};
用这个data生成params,经常取到的值为空,偶尔能正确取到,我看到你在request也加了判断,反复取,是这个data格式还是不够正确吗,我用网页抓到的params每次都能正确取到
部署这个服务器可以给下教程吗?
请问你找到pc客户端api的加密方式了吗?
pc客户端有些接口和web的加密不一样,只有一个加密参数param,看你的api里好像没有相关的接口
node app.js
的时候报错信息
const crypto = require('crypto');
^^^^^
SyntaxError: Use of const in strict mode.
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/data/wwwroot/www.lyawei.cn/app.js:1:77)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
你好,
这个项目有意向增加 云盘上传的接口吗?
C:\Users\Administrator\Desktop\项目\netmusic-node-master\netmusic-node-master>npm install
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] No repository field.
added 95 packages from 99 contributors in 5.502s
C:\Users\Administrator\Desktop\项目\netmusic-node-master\netmusic-node-master>node app.js
启动App
首先项目在本地已经完美跑起来,感谢开源
后端小白问下,这份 node 代码能跑到服务器上,然后 localhost:3000 改成对应的 IP 或 域名来访问么
获取歌曲URL的接口有cheating问题,可以参考这个修复
darknessomi/musicbox#745
直接node app.js 然后怎么和客户端结合,客户端需要改哪些东西?
在执行$ node app.js | pm2 app.js时,
提示
stdout is not a tty
搜了下也没有找到解决问题,请问这个应该怎么解决
想问一下登陆接口坏掉了欸,能不能修一下
大佬您好,请问下了接口后要怎么启动,直接cmd管理员执行然后app.js吗,我下载好了小程序源码和这个包中的接口,接下来要怎么操作
mv视频播放不了,不知道怎么回事
Failed to load http://192.168.1.6:3000/v1/banner: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access.
看到作者有设置 res.header("Access-Control-Allow-Origin", "*");
但是跑起来还是报错
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.