Skip to content
This repository was archived by the owner on Apr 16, 2024. It is now read-only.

Commit e5caf7a

Browse files
authored
Merge pull request #740 from TimonPeng/master
新增购买专辑接口
2 parents 0beb4e7 + c3d2817 commit e5caf7a

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

docs/README.md

+15
Original file line numberDiff line numberDiff line change
@@ -2453,6 +2453,21 @@ type='1009' 获取其 id, 如`/search?keywords= 代码时间 &type=1009`
24532453

24542454
**调用例子 :** `/digitalAlbum/purchased?limit=10`
24552455

2456+
### 购买数字专辑
2457+
说明 : 登陆后调用此接口 ,可购买数字专辑
2458+
2459+
**必选参数 :**
2460+
2461+
`id` : 专辑的 id
2462+
2463+
`payment` : 支付方式, 0 为支付宝 3 为微信
2464+
2465+
`quantity` : 购买的数量
2466+
2467+
**接口地址 :** `/digitalAlbum/ordering`
2468+
2469+
**调用例子 :** `/digitalAlbum/ordering?id=86286082&payment=3&quantity=1`
2470+
24562471
### batch批量请求接口
24572472
说明 : 登陆后调用此接口 ,传入接口和对应原始参数(原始参数非文档里写的参数,需参考源码),可批量请求接口
24582473

module/digitalAlbum_ordering.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// 购买数字专辑
2+
3+
module.exports = (query, request) => {
4+
const data = {
5+
business: 'Album',
6+
paymentMethod: query.payment,
7+
digitalResources: JSON.stringify([{
8+
business: 'Album',
9+
resourceID: query.id,
10+
quantity: query.quantity,
11+
}]),
12+
from: 'web'
13+
}
14+
return request(
15+
'POST', `https://music.163.com/api/ordering/web/digital`, data,
16+
{crypto: 'weapi', cookie: query.cookie, proxy: query.proxy}
17+
)
18+
}

0 commit comments

Comments
 (0)