前言:最近做了慕课网上的vue播放器,做的过程中,花费了大量的时间去找api,为了方便大家学习,特意写了个后台来抓取qq音乐的api,有需要的可以粘贴运行,处理一下跨域就能用了:

const axios = require('axios')
const express = require('express')
const app = express()
const Router = express.Router()// 获取推荐歌单
app.get('/api/apiData', (req, res) => {const url = 'https://u.y.qq.com/cgi-bin/musics.fcg?-=recom04079145148486929&g_tk=413529511&sign=zzahy5a2de1886ff15c4441255ee9ef959d8dacccc3f88&loginUin=1982414933&hostUin=0&format=json&inCharset=utf8&outCharset=utf-8&notice=0&platform=yqq.json&needNewCode=0&data=%7B%22comm%22%3A%7B%22ct%22%3A24%7D%2C%22category%22%3A%7B%22method%22%3A%22get_hot_category%22%2C%22param%22%3A%7B%22qq%22%3A%22%22%7D%2C%22module%22%3A%22music.web_category_svr%22%7D%2C%22recomPlaylist%22%3A%7B%22method%22%3A%22get_hot_recommend%22%2C%22param%22%3A%7B%22async%22%3A1%2C%22cmd%22%3A2%7D%2C%22module%22%3A%22playlist.HotRecommendServer%22%7D%2C%22playlist%22%3A%7B%22method%22%3A%22get_playlist_by_category%22%2C%22param%22%3A%7B%22id%22%3A8%2C%22curPage%22%3A1%2C%22size%22%3A40%2C%22order%22%3A5%2C%22titleid%22%3A8%7D%2C%22module%22%3A%22playlist.PlayListPlazaServer%22%7D%2C%22new_song%22%3A%7B%22module%22%3A%22newsong.NewSongServer%22%2C%22method%22%3A%22get_new_song_info%22%2C%22param%22%3A%7B%22type%22%3A5%7D%7D%2C%22new_album%22%3A%7B%22module%22%3A%22newalbum.NewAlbumServer%22%2C%22method%22%3A%22get_new_album_info%22%2C%22param%22%3A%7B%22area%22%3A1%2C%22sin%22%3A0%2C%22num%22%3A20%7D%7D%2C%22new_album_tag%22%3A%7B%22module%22%3A%22newalbum.NewAlbumServer%22%2C%22method%22%3A%22get_new_album_area%22%2C%22param%22%3A%7B%7D%7D%2C%22toplist%22%3A%7B%22module%22%3A%22musicToplist.ToplistInfoServer%22%2C%22method%22%3A%22GetAll%22%2C%22param%22%3A%7B%7D%7D%2C%22focus%22%3A%7B%22module%22%3A%22music.musicHall.MusicHallPlatform%22%2C%22method%22%3A%22GetFocus%22%2C%22param%22%3A%7B%7D%7D%7D'axios.get(url).then(response => {res.json(response.data)})
})
// 获取歌手
app.get('/api/apiSinger', (req, res) => {const url = 'https://c.y.qq.com/v8/fcg-bin/v8.fcg?g_tk=1928093487&inCharset=utf-8&outCharset=utf-8&notice=0&format=jsonp&channel=singer&page=list&key=all_all_all&pagesize=100&pagenum=1&hostUin=0&needNewCode=0&platform=yqq'axios.get(url).then(response => {res.json(response.data)}).catch(err => {console.log(err)})
})
// 获取播放地址
app.get('/api/apiGetUrlPlay', (req, res) => {// 需要歌的midconst url = 'https://u.y.qq.com/cgi-bin/musicu.fcg??format=json&data=%7B%22req_0%22%3A%7B%22module%22%3A%22vkey.GetVkeyServer%22%2C%22method%22%3A%22CgiGetVkey%22%2C%22param%22%3A%7B%22guid%22%3A%22358840384%22%2C%22songmid%22%3A%5B%22' + req.query.mid + '%22%5D%2C%22songtype%22%3A%5B0%5D%2C%22uin%22%3A%221443481947%22%2C%22loginflag%22%3A1%2C%22platform%22%3A%2220%22%7D%7D%2C%22comm%22%3A%7B%22uin%22%3A%2218585073516%22%2C%22format%22%3A%22json%22%2C%22ct%22%3A24%2C%22cv%22%3A0%7D%7D'axios.get(url).then(response => {res.json(response.data)}).catch(err => {console.log(err)})
})
// 获取歌词
app.get('/api/getLyric', (req, res) => {let url = 'https://c.y.qq.com/lyric/fcgi-bin/fcg_query_lyric_new.fcg'axios.get(url, {params: {hostUin: 0,needNewCode: 0,categoryId: 10000000,pcachetime: +new Date(),format: 'json',songmid: req.query.mid, //歌的midg_tk_new_20200303: 5381,g_tk: 5381,loginUin: 0,inCharset: 'utf8',outCharset: 'utf-8',notice: 0,platform: 'yqq.json',},headers: {origin: 'https://y.qq.com',referer: 'https://y.qq.com/portal/player.html'}}).then(response => {res.json(response.data)})
})//获取推荐歌单中的歌
app.get('/api/getRecommendList', (req, res) => {let url = 'https://c.y.qq.com/qzone/fcg-bin/fcg_ucc_getcdinfo_byids_cp.fcg'axios.get(url, {params: {type: 1,json: 1,utf8: 1,onlysong: 0,new_format: 1,disstid: req.query.discId, // 歌单的discIdg_tk_new_20200303: 5381,g_tk: 5381,loginUin: 0,hostUin: 0,format: 'json',inCharset: 'utf8',outCharset: 'utf-8',notice: 0,platform: 'yqq.json',needNewCode: 0},headers: {origin: 'https://y.qq.com',referer: 'https://y.qq.com/portal/player.html'}}).then(response => {res.json(response.data)})
})//获取排行榜歌单类别
app.get('/api/getTopList', (req, res) => {let url = 'https://c.y.qq.com/v8/fcg-bin/fcg_myqq_toplist.fcg'axios.get(url, {params: {g_tk: 1928093487,inCharset: 'utf-8',outCharset: 'utf-8',notice: 0,format: 'json',uin: 0,needNewCode: 1,platform: 'h5'},headers: {origin: 'https://y.qq.com',referer: 'https://y.qq.com/portal/player.html'}}).then(response => {res.json(response.data)})
})
//获取排行榜歌单对应的歌列表
app.get('/api/getMusicList', (req, res) => {let url = `https://c.y.qq.com/v8/fcg-bin/fcg_v8_toplist_cp.fcg`axios.get(url, {params: {topid: req.query.topId, // 排行榜的topIdplatform: 'yqq.json',format: 'json'},headers: {origin: 'https://y.qq.com',referer: 'https://y.qq.com/portal/player.html'}}).then(response => {res.json(response.data)})
})// 获取热搜关键词
app.get('/api/getHotKey', (req, res) => {let url = `https://c.y.qq.com/splcloud/fcgi-bin/gethotkey.fcg`axios.get(url, {params: {g_tk_new_20200303: 5381,g_tk: 5381,loginUin: 0,hostUin: 0,format: 'json',inCharset: 'utf8',outCharset: 'utf-8',notice: 0,platform: 'yqq.json',needNewCode: 0},headers: {origin: 'https://y.qq.com',referer: 'https://y.qq.com/portal/player.html'}}).then(response => {res.json(response.data)})
})// 根据关键字进行搜索
app.get('/api/search', (req, res) => {let url = `https://c.y.qq.com/soso/fcgi-bin/client_search_cp`axios.get(url, {params: {catZhida: req.query.showSinger ? 1 : 0,p: req.query.page, n: req.query.perpage, // w: req.query.key, // 关键字format: 'json',inCharset: 'utf8',outCharset: 'utf-8'},headers: {origin: 'https://y.qq.com',referer: 'https://y.qq.com/portal/player.html'}}).then(response => {res.json(response.data)})
})
app.use(express.static('./dist'))
app.listen(8080, (err) => {if (err) {return console.log(err)}console.log('http://localhost:8080正在运行')
})

慕课网vue播放器最新QQ音乐api相关推荐

  1. iOS之基于FreeStreamer的简单音乐播放器(模仿QQ音乐)

    代码地址如下: http://www.demodashi.com/demo/11944.html 天道酬勤 前言 作为一名iOS开发者,每当使用APP的时候,总难免会情不自禁的去想想,这个怎么做的?该 ...

  2. android+仿ios+音乐播放器,iOS简单的音乐播放器(仿QQ音乐)

    AVPlayer实现基本的播放,暂停,上一首,下一首,调节音量,调节进度等,正在学习的新人可以看下,有什么不足可以互相学习,谢谢支持 qq音乐.gif 这个是我写的一个简单的低仿QQ音乐, 如果你也喜 ...

  3. ios音乐播放器-仿QQ音乐

    这篇文章主要写一个iOS系统下的音乐播放器 , 包括简单的仿QQ音乐播放器界面.音乐播放.歌词解析.后台控制等  ,如果你正好需要 , 希望你看完后能够对你的提升有所帮助 , 当然,阅读中如果发现什么 ...

  4. 在线音乐播放器-----酷狗音乐api接口抓取

    首先身为一个在线音乐播放器,需要前端和数据库的搭配使用. 在数据库方面,我们没有办法制作,首先是版权问题,再加上数据量.所以我们需要借用其他网络播放器的数据库. 但是这些在线播放器,如百度,酷狗,酷我 ...

  5. 网易云音乐/QQ音乐API更新,支持多音质切换/MV获取

    自从上一版开源过后到现在音乐接口的调用量已经达到了快100W,但是最近由于网易云的更新,导致部分接口不能使用,最近在工作之余抽出时间把API重写. 本次API版本不再使用PHP,使用Java,相比以前 ...

  6. Android开发本地及网络Mp3音乐播放器(十三)网络音乐搜索功能实现,歌名歌手专辑名搜索

    转载请注明出处:http://blog.csdn.net/iwanghang/article/details/51298411 觉得博文有用,请点赞,请留言,请关注,谢谢!~ 实现功能: 实现网络音乐 ...

  7. linux安装深度播放器,分享|Ubuntu 14.04 用户如何安装深度音乐播放器和百度音乐插件...

    播放本地音乐或者收听国外的音乐电台,Ubuntu 14.04 自带的音乐播放器 Rhythmbox 完全能够满足,但是如果你想有像酷狗那样的国内播放器就需要折腾一下,还好有深度音乐播放器,这是一款完全 ...

  8. android音乐播放器git,Android音乐播放器

    Android音乐播放器 介绍 Android音乐播放器开发 进度 算是全部完成了,后续只会改进了. 如何使用 按这篇博客修改一下gradle相关文件,匹配自己的开发环境 日志 2020.12.15 ...

  9. 酷播v4.0免费播放器最新最简短代码范例

    酷播v4.0免费播放器最新最简短代码范例 1. 增加播放器优先级选项: 2. 增加支持PC端和移动端的视频预览功能(收费预览视频功能): 3. 增加微信中的logo显示 ( iOS下支持): 4. 配 ...

  10. js封装QQ音乐api

    QQ音乐api文档地址:QQ音乐api文档 封装好后的api文件地址:需要引入请求封装文件-/ajax.js https://github.com/1015770492/yumbo-vue/blob/ ...

最新文章

  1. ios 设置属性的center_IOS开发-常用UI控件的基本使用(Transform形变属性、frame属性、center属性的使用)...
  2. 谷歌地图最新hosts_如何查看2020最新版谷歌地球高精度卫星地图(附下载方法)...
  3. Hadoop MapReduce实例:按手机上网总流量降序排序代码实现及结果演示
  4. asp服务器组件安装包,ASP服务器组件
  5. 转:一个Sqrt函数引发的血案
  6. 怎样为Mac视频添加音频
  7. Atitit 常用微服务实现 目录 1. 健康检测 max_fails与fail_timeout参 数 1 1.1. spring cloud dubbo实现 2 1.2. 、nginx多个tomc
  8. [luoguP1373] 小a和uim之大逃离(DP)
  9. 一张图了解CAS单点登录的流程
  10. python 中in
  11. net stop sharedaccess命令 2009-1-15 11:10
  12. WPS 2019专业版制作柱状图含折线图图表(本次为年终数据PPT制作)
  13. 【二】HTML:图像标签和超链接标签
  14. 12306对抢票软件“下手”了 1
  15. 一文带你了解c++使用endl和使用‘\n‘的区别
  16. Android关闭输入法
  17. 差之毫厘:etcd 3 完美支持 HTTP 访问
  18. item_password-获得淘口令真实url接口,淘宝app短链接商品接口,1688商品淘口令url接口
  19. 2013搜狗校招研发类C/C++试题
  20. 【附源码】计算机毕业设计SSM社区生鲜电商平台

热门文章

  1. 深度学习剖根问底:SGD算法的优化和变种
  2. 关于si4438以往犯的一些错误
  3. 易语言的Java皮肤_易语言软件更换皮肤的方法
  4. C#使用NOPI导入Excel
  5. 大华工业相机SDK【QT+ C++】vs2015配置环境
  6. html中使用js实现体彩11选5随机选号
  7. maven 打包跳过test的命令
  8. 取消idm下载器和google浏览器的关联(让谷歌浏览器禁止使用idm插件)
  9. 基于机器学习的回归拟合、详细总结
  10. 回弹怎么用计算机计算,回弹法检测混凝土抗压强度标准差和推定值的计算方法 公式...