mirror of
https://gitlab.com/Binaryify/neteasecloudmusicapi.git
synced 2025-05-23 22:37:41 +08:00
新增排行榜接口
This commit is contained in:
parent
e4327ecad5
commit
02e7582db6
4
app.js
4
app.js
@ -7,6 +7,7 @@ app.use('/login/cellphone', require('./router/loginCellphone'))
|
|||||||
|
|
||||||
//邮箱登录
|
//邮箱登录
|
||||||
app.use('/login', require('./router/login'))
|
app.use('/login', require('./router/login'))
|
||||||
|
|
||||||
//获取评论
|
//获取评论
|
||||||
app.use('/comment', require('./router/comment'))
|
app.use('/comment', require('./router/comment'))
|
||||||
|
|
||||||
@ -50,6 +51,9 @@ app.use("/daily_signin",require("./router/daily_signin"))
|
|||||||
//垃圾桶
|
//垃圾桶
|
||||||
app.use("/fm_trash",require("./router/fm_trash"))
|
app.use("/fm_trash",require("./router/fm_trash"))
|
||||||
|
|
||||||
|
//排行榜
|
||||||
|
app.use("/top_list",require("./router/top_list"))
|
||||||
|
|
||||||
process.on('SIGHUP', () => {
|
process.on('SIGHUP', () => {
|
||||||
console.log('server: bye bye')
|
console.log('server: bye bye')
|
||||||
process.exit()
|
process.exit()
|
||||||
|
@ -311,7 +311,46 @@ $ set PORT=4000 && node app.js
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
### 排行榜
|
||||||
|
说明:调用此接口,传入数字 idx, 可获取不同排行榜
|
||||||
|
|
||||||
|
**必选参数:**
|
||||||
|
` idx`: 对象 key, 对应以下排行榜
|
||||||
|
|
||||||
|
```
|
||||||
|
"0": 云音乐新歌榜,
|
||||||
|
"1": 云音乐热歌榜,
|
||||||
|
"2": 网易原创歌曲榜,
|
||||||
|
"3": 云音乐飙升榜,
|
||||||
|
"4": 云音乐电音榜,
|
||||||
|
"5": UK排行榜周榜,
|
||||||
|
"6": 美国Billboard周榜
|
||||||
|
"7": KTV嗨榜,
|
||||||
|
"8": iTunes榜,
|
||||||
|
"9": Hit FM Top榜,
|
||||||
|
"10": 日本Oricon周榜
|
||||||
|
"11": 韩国Melon排行榜周榜,
|
||||||
|
"12": 韩国Mnet排行榜周榜,
|
||||||
|
"13": 韩国Melon原声周榜,
|
||||||
|
"14": 中国TOP排行榜(港台榜),
|
||||||
|
"15": 中国TOP排行榜(内地榜)
|
||||||
|
"16": 香港电台中文歌曲龙虎榜,
|
||||||
|
"17": 华语金曲榜,
|
||||||
|
"18": 中国嘻哈榜,
|
||||||
|
"19": 法国 NRJ EuroHot 30周榜,
|
||||||
|
"20": 台湾Hito排行榜,
|
||||||
|
"21": Beatport全球电子舞曲榜
|
||||||
|
```
|
||||||
|
|
||||||
|
**接口地址:**
|
||||||
|
`/top_list`
|
||||||
|
|
||||||
|
**调用例子:**
|
||||||
|
`/top_list?idx=6`
|
||||||
|
|
||||||
|
返回数据如下图:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
## 离线访问此文档
|
## 离线访问此文档
|
||||||
此文档同时也是 Progressive Web Apps(PWA), 加入了serviceWorker,可离线访问
|
此文档同时也是 Progressive Web Apps(PWA), 加入了serviceWorker,可离线访问
|
||||||
|
43
router/top_list.js
Normal file
43
router/top_list.js
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
const top_list_all = {
|
||||||
|
"0": ['云音乐新歌榜', '/api/playlist/detail?id=3779629'],
|
||||||
|
"1": ['云音乐热歌榜', '/api/playlist/detail?id=3778678'],
|
||||||
|
"2": ['网易原创歌曲榜', '/api/playlist/detail?id=2884035'],
|
||||||
|
"3": ['云音乐飙升榜', '/api/playlist/detail?id=19723756'],
|
||||||
|
"4": ['云音乐电音榜', '/api/playlist/detail?id=10520166'],
|
||||||
|
"5": ['UK排行榜周榜', '/api/playlist/detail?id=180106'],
|
||||||
|
"6": ['美国Billboard周榜', '/api/playlist/detail?id=60198'],
|
||||||
|
"7": ['KTV嗨榜', '/api/playlist/detail?id=21845217'],
|
||||||
|
"8": ['iTunes榜', '/api/playlist/detail?id=11641012'],
|
||||||
|
"9": ['Hit FM Top榜', '/api/playlist/detail?id=120001'],
|
||||||
|
"10": ['日本Oricon周榜', '/api/playlist/detail?id=60131'],
|
||||||
|
"11": ['韩国Melon排行榜周榜', '/api/playlist/detail?id=3733003'],
|
||||||
|
"12": ['韩国Mnet排行榜周榜', '/api/playlist/detail?id=60255'],
|
||||||
|
"13": ['韩国Melon原声周榜', '/api/playlist/detail?id=46772709'],
|
||||||
|
"14": ['中国TOP排行榜(港台榜)', '/api/playlist/detail?id=112504'],
|
||||||
|
"15": ['中国TOP排行榜(内地榜)', '/api/playlist/detail?id=64016'],
|
||||||
|
"16": ['香港电台中文歌曲龙虎榜', '/api/playlist/detail?id=10169002'],
|
||||||
|
"17": ['华语金曲榜', '/api/playlist/detail?id=4395559'],
|
||||||
|
"18": ['中国嘻哈榜', '/api/playlist/detail?id=1899724'],
|
||||||
|
"19": ['法国 NRJ EuroHot 30周榜', '/api/playlist/detail?id=27135204'],
|
||||||
|
"20": ['台湾Hito排行榜', '/api/playlist/detail?id=112463'],
|
||||||
|
"21": ['Beatport全球电子舞曲榜', '/api/playlist/detail?id=3812895']
|
||||||
|
}
|
||||||
|
const express = require("express")
|
||||||
|
const router = express()
|
||||||
|
const { createRequest } = require("../util/util")
|
||||||
|
|
||||||
|
router.get("/", (req, res) => {
|
||||||
|
const idx = req.query.idx
|
||||||
|
const action = 'http://music.163.com' + top_list_all[idx][1]
|
||||||
|
createRequest(`${action}`, 'GET', null)
|
||||||
|
.then(result => {
|
||||||
|
res.setHeader("Content-Type", "application/json")
|
||||||
|
res.send(result)
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
res.status(502).send('fetch error')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
module.exports = router
|
Loading…
x
Reference in New Issue
Block a user