• Stars
    star
    1,350
  • Rank 34,796 (Top 0.7 %)
  • Language
    JavaScript
  • License
    GNU General Publi...
  • Created about 5 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

基于 Express + Axios 的 QQ音乐接口 nodejs 版

QQMusicApi

NPM github GitHub Pages Star

接口参考:

接口文档 Github

接口文档 Vercel

快速上手

Node 服务

git clone [email protected]:jsososo/QQMusicApi.git

yarn

yarn start

Docker

yarn build:docker

yarn start:docker

npm

yarn add qq-music-api

接口调用

const qqMusic = require('qq-music-api');

// 部分接口依赖 cookie, 这里穿参可以使用字符串或对象
qqMusic.setCookie('xxx=xxx; xxx=xxx;');
// or
qqMusic.setCookie({ a: 'xxx', b: 'xxx' });

qqMusic.api('search', { key: '周杰伦' })
    .then(res => console.log(res))
    .catch(err => console.log('接口调用出错'))

qqMusic.api('search', { key: '周杰伦' })
    .then((res) => console.log('搜索周杰伦:', res))
    .catch(err => console.log('接口调用出错'))

qqMusic.api('search/hot')
    .then((res) => console.log('热搜词:', res))
    .catch(err => console.log('接口调用出错'))//

// 刷新登陆
qqMusic.api('user/refresh')

获取当前cookie

const qqMusic = require('qq-music-api');

console.log(qqMusic.cookie);

获取当前 cookie 用户

const qqMusic = require('qq-music-api');

console.log(qqMusic.uin);