Skip to content

Commit

Permalink
Merge pull request Binaryify#1 from Means88/add-pay
Browse files Browse the repository at this point in the history
添加获取付费电台的 API
  • Loading branch information
Means88 authored Jul 27, 2018
2 parents a05170a + e4b338d commit 80fb842
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1266,6 +1266,14 @@ type='1009' 获取其 id, 如`/search?keywords= 代码时间 &type=1009`

**调用例子 :** `/dj/sublist`

### 电台 - 付费精选

说明 : 可以获取付费精选的电台列表 , 传入 `limit``offset` 可以进行分页

**接口地址 :** `/dj/paygift`

**调用例子 :** `/dj/paygift?limit=10&offset=20`

### 电台 - 详情

说明 : 登陆后调用此接口 , 传入`rid`, 可获得对应电台的详情介绍
Expand Down
20 changes: 20 additions & 0 deletions router/dj_paygift.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// 付费电台
module.exports = (req, res, createWebAPIRequest, request) => {
const cookie = req.get("Cookie") ? req.get("Cookie") : "";
const data = {
csrf_token: "",
limit: req.query.limit || 10,
offset: req.query.offset || 0,
};
createWebAPIRequest(
"music.163.com",
"/weapi/djradio/home/paygift/list?_nmclfl=1",
"POST",
data,
cookie,
music_req => {
res.send(music_req);
},
err => res.status(502).send("fetch error")
);
};

0 comments on commit 80fb842

Please sign in to comment.