mod: triple

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-02-23 15:10:31 +08:00
parent e573a8a9c0
commit 16de044d3d
2 changed files with 11 additions and 3 deletions

View File

@@ -455,7 +455,7 @@ class VideoHttp {
}
// 一键三连 bangumi
static Future triple({dynamic epId}) async {
static Future triple({dynamic epId, required dynamic seasonId}) async {
var res = await Request().post(
Api.triple,
data: {
@@ -463,8 +463,11 @@ class VideoHttp {
'csrf': await Request.getCsrf(),
},
options: Options(
contentType: Headers.formUrlEncodedContentType,
headers: {
'Content-Type': Headers.formUrlEncodedContentType,
'origin': 'https://www.bilibili.com',
'referer': 'https://www.bilibili.com/bangumi/play/ss$seasonId',
'user-agent': Request.headerUa(type: 'pc'),
},
),
);
@@ -489,6 +492,11 @@ class VideoHttp {
},
options: Options(
contentType: Headers.formUrlEncodedContentType,
headers: {
'origin': 'https://www.bilibili.com',
'referer': 'https://www.bilibili.com/video/$bvid',
'user-agent': Request.headerUa(type: 'pc'),
},
),
);
if (res.data['code'] == 0) {

View File

@@ -628,7 +628,7 @@ class BangumiIntroController extends CommonController {
SmartDialog.showToast('已三连');
return false;
}
var result = await VideoHttp.triple(epId: epId);
var result = await VideoHttp.triple(epId: epId, seasonId: seasonId);
if (result['status']) {
hasLike.value = result["data"]["like"] == 1;
hasCoin.value = result["data"]["coin"] == 1;