From 402cf0fbf27f4c0b07109d1696c78861d9f5dc95 Mon Sep 17 00:00:00 2001 From: TimonPeng Date: Sat, 18 Apr 2020 12:23:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=B4=AD=E4=B9=B0=E4=B8=93?= =?UTF-8?q?=E8=BE=91=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/README.md | 15 +++++++++++++++ module/digitalAlbum_ordering.js | 18 ++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 module/digitalAlbum_ordering.js diff --git a/docs/README.md b/docs/README.md index 2820f58..3129f4c 100644 --- a/docs/README.md +++ b/docs/README.md @@ -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批量请求接口 说明 : 登陆后调用此接口 ,传入接口和对应原始参数(原始参数非文档里写的参数,需参考源码),可批量请求接口 diff --git a/module/digitalAlbum_ordering.js b/module/digitalAlbum_ordering.js new file mode 100644 index 0000000..3396ea0 --- /dev/null +++ b/module/digitalAlbum_ordering.js @@ -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/weapi/ordering/web/digital`, data, + {crypto: 'weapi', cookie: query.cookie, proxy: query.proxy} + ) +} \ No newline at end of file