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

Commit

Permalink
Merge pull request #740 from TimonPeng/master
Browse files Browse the repository at this point in the history
新增购买专辑接口
  • Loading branch information
Binaryify authored Apr 20, 2020
2 parents 0beb4e7 + c3d2817 commit e5caf7a
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2453,6 +2453,21 @@ type='1009' 获取其 id, 如`/search?keywords= 代码时间 &type=1009`

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

### 购买数字专辑
说明 : 登陆后调用此接口 ,可购买数字专辑

**必选参数 :**

`id` : 专辑的 id

`payment` : 支付方式, 0 为支付宝 3 为微信

`quantity` : 购买的数量

**接口地址 :** `/digitalAlbum/ordering`

**调用例子 :** `/digitalAlbum/ordering?id=86286082&payment=3&quantity=1`

### batch批量请求接口
说明 : 登陆后调用此接口 ,传入接口和对应原始参数(原始参数非文档里写的参数,需参考源码),可批量请求接口

Expand Down
18 changes: 18 additions & 0 deletions module/digitalAlbum_ordering.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// 购买数字专辑

module.exports = (query, request) => {
const data = {
business: 'Album',
paymentMethod: query.payment,
digitalResources: JSON.stringify([{
business: 'Album',
resourceID: query.id,
quantity: query.quantity,
}]),
from: 'web'
}
return request(
'POST', `https://music.163.com/api/ordering/web/digital`, data,
{crypto: 'weapi', cookie: query.cookie, proxy: query.proxy}
)
}

0 comments on commit e5caf7a

Please sign in to comment.