Recently I am learning to make a web mobile music player. Because I don’t want to store data in a database, I am learning to get some data in the QQ music interface

Other data normal, but can not play friends can try this

Yesterday found two useful broadcast source, I hope to give some help to like-minded friends

Here is the use of songmid url: ` http://isure.stream.qqmusic.qq.com/C100${musicData. Songmid}. : m4a? Fromtag = 32 ` url: `http://thirdparty.gtimg.com/C100${musicData.songmid}.m4a?fromtag=38`Copy the code

Get playlist data:

Url: c.y.qq.com/splcloud/fc…




//songList.js export function getDiscList() { const url = '/api/getDiscList' const data = Object.assign({}, commonParams, { platform: 'yqq', hostUin: 0, sin: 0, ein: 29, sortId: 5, needNewCode: 0, categoryId: 10000000, rnd: Math.random(), format: 'json' }) return axios.get(url, { params: Data}).then((res) => {return promise.resolve (res.data)})} webpack.dev.conf.js Send an HTTP request from the real QQ music address, and modify a headers. @param {[type]} req [require] * @param {String} res [response] * @param {Function} params: Req.query [parameter] * @return {[type]} [description] */ apiRoutes. Get ('/ API /getDiscList', function(req, res) { var url = 'https://c.y.qq.com/splcloud/fcgi-bin/fcg_get_diss_by_tag.fcg' axios.get(url, { headers: { referer: 'https://c.y.qq.com/', host: 'c.y.qq.com' }, params: Req.query}).then((response) => {// return data to the front-end res.json(response.data)}).catch((e) => {console.log(e)})})Copy the code

To obtain the data of the rotation chart:

Url: c.y.qq.com/musichall/f…




export function getRecommend() {
    const url = 'https://c.y.qq.com/musichall/fcgi-bin/fcg_yqqhomepagerecommend.fcg'
    const data = Object.assign({}, commonParams, {
        platform: 'h5',
        uin: 0,
        needNewCode: 1
    })
    return jsonp(url, data, options)
}
Copy the code

Get lyric data:

Url: c.y.qq.com/lyric/fcgi-…




export function getDiscList() { const url = '/api/getDiscList' const data = Object.assign({}, commonParams, { platform: 'yqq', hostUin: 0, sin: 0, ein: 29, sortId: 5, needNewCode: 0, categoryId: 10000000, rnd: Math.random(), format: 'jsonp' }) return axios.get(url, { params: data }).then((res) => { return Promise.resolve(res.data) }) } // webpack.dev.conf.js apiRoutes.get('/api/lyric', function(req, res) { var url = 'https://c.y.qq.com/lyric/fcgi-bin/fcg_query_lyric_new.fcg' axios.get(url, { headers: { referer: 'https://c.y.qq.com', host: 'c.y.qq.com' }, params: req.query }).then((response) => { var ret = response.data if (typeof ret === 'string') { var reg = /^\w+\(({[^()]+})\)$/  var matches = ret.match(reg) if (matches) { ret = JSON.parse(matches[1]) } } res.json(ret) }).catch((e) => { console.log(e) }) })Copy the code

Get singer information:

Url: szc.y.qq.com/v8/fcg-bin/…




export function getSingerList() {
    const url = 'https://c.y.qq.com/v8/fcg-bin/v8.fcg'
    const data = Object.assign({}, commonParams, {
        channel: 'singer',
        page: 'list',
        key: 'all_all_all',
        pagesize: 100,
        pagenum: 1,
        hostUin: 0,
        needNewCode: 0,
        platform: 'yqq',
        g_tk: 2001751543
    })
    return jsonp(url, data, options)
}
Copy the code

For song details:

Url: c.y.qq.com/v8/fcg-bin/…





export function getSingerDetail(singerId) { const url = 'https://c.y.qq.com/v8/fcg-bin/fcg_v8_singer_track_cp.fcg' const  data = Object.assign({}, commonParams, { hostUin: 0, needNewCode: 0, order: 'listen', platform: 'h5page', begin: 0, num: 100, songstatus: 1, singermid: singerId, g_tk: 2001751543 }) return jsonp(url, data, options) }Copy the code

Get leaderboard data (grab mobile) :

Url: c.y.qq.com/v8/fcg-bin/…




Get playlist song list:

Url: c.y.qq.com/qzone/fcg-b…




For details of the list (mobile) :

Url: c.y.qq.com/v8/fcg-bin/…