fix: bangumi

This commit is contained in:
bggRGjQaUbCoE
2024-10-01 22:49:17 +08:00
parent 015edd26a3
commit 9d816d1b96
3 changed files with 55 additions and 9 deletions

View File

@@ -92,6 +92,8 @@ class Api {
// https://api.bilibili.com/x/v3/fav/resource/deal
static const String favVideo = '/x/v3/fav/resource/deal';
static const String favBangumi = '/x/v3/fav/resource/batch-deal';
// 判断视频是否被收藏双端GET
/// aid
// https://api.bilibili.com/x/v2/fav/video/favoured

View File

@@ -524,10 +524,47 @@ class VideoHttp {
}
}
// (取消)收藏 bangumi
static Future favBangumi({
required dynamic epId,
String? addIds,
String? delIds,
}) async {
var res = await Request().post(
Api.favBangumi,
data: {
'resources': '$epId:24',
'add_media_ids': addIds ?? '',
'del_media_ids': delIds ?? '',
'csrf': await Request.getCsrf(),
},
options: Options(
headers: {
'Content-Type': Headers.formUrlEncodedContentType,
},
),
);
if (res.data['code'] == 0) {
return {'status': true, 'data': res.data['data']};
} else {
return {'status': false, 'msg': res.data['message']};
}
}
// 查看视频被收藏在哪个文件夹
static Future videoInFolder({required int mid, required int rid}) async {
var res = await Request()
.get(Api.videoInFolder, data: {'up_mid': mid, 'rid': rid});
static Future videoInFolder({
dynamic mid,
dynamic rid,
dynamic type,
}) async {
var res = await Request().get(
Api.videoInFolder,
data: {
'up_mid': mid,
'rid': rid,
if (type != null) 'type': type,
},
);
if (res.data['code'] == 0) {
FavFolderData data = FavFolderData.fromJson(res.data['data']);
return {'status': true, 'data': data};