Skip to content

Commit

Permalink
feat: 增加云贝任务 浏览会员中心
Browse files Browse the repository at this point in the history
  • Loading branch information
chen310 committed Mar 11, 2022
1 parent 4c46d1e commit 9e4e227
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,11 @@ REGION 默认为 `ap-guangzhou` ,可选的地域详见[地域列表](https://c
"taskName": "分享歌曲/歌单",
"module": "share",
"enable": false
},
"656007": {
"taskName": "浏览会员中心",
"module": "visitVipCenter",
"enable": false
}
},
// ...
Expand All @@ -266,6 +271,8 @@ REGION 默认为 `ap-guangzhou` ,可选的地域详见[地域列表](https://c

`分享歌曲/歌单`任务并不会真的分享,将 `enable` 设为 `true` 即可开启任务

`浏览会员中心``enable` 设为 `true` 即可开启任务

#### 音乐人任务

```json5
Expand Down
5 changes: 5 additions & 0 deletions api.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,3 +517,8 @@ def circle_get(self, circleId):
path = "/weapi/circle/get"
params = dict(circleId=circleId)
return self.request("POST", path, params)

def vipcenter_task_external(self, type):
path = "/weapi/vipnewcenter/app/level/task/external"
params = dict(type=type)
return self.request("POST", path, params)
7 changes: 7 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,13 @@
"module": "share",
/* 是否开启任务 */
"enable": false
},
/* 浏览会员中心 */
"656007": {
"taskName": "浏览会员中心",
"module": "visitVipCenter",
/* 是否开启任务 */
"enable": false
}
},
/* 音乐人任务,登录音乐人中心默认开启,其他按需开启 */
Expand Down
8 changes: 8 additions & 0 deletions task/visitVipCenter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
def start(user, task={}):
music = user.music

resp = music.vipcenter_task_external(1)
if resp['code'] == 200:
user.taskInfo(task['taskName'], '浏览成功')
else:
user.taskInfo(task['taskName'], user.errMsg(resp))

0 comments on commit 9e4e227

Please sign in to comment.