refa fav video

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-07-24 12:40:29 +08:00
parent 6d48c70020
commit 0c6bc9d58a
11 changed files with 118 additions and 58 deletions

View File

@@ -102,11 +102,9 @@ class Api {
// csrf str CSRF Token位于cookie Cookie方式必要
// https://api.bilibili.com/medialist/gateway/coll/resource/deal
// https://api.bilibili.com/x/v3/fav/resource/deal
static const String favVideo = '/x/v3/fav/resource/deal';
static const String favVideo = '/x/v3/fav/resource/batch-deal';
// static const String favBangumi = '/x/v3/fav/resource/batch-deal';
static const String delFav = '/x/v3/fav/resource/batch-del';
static const String unfavAll = '/x/v3/fav/resource/unfav-all';
static const String copyFav = '/x/v3/fav/resource/copy';

View File

@@ -593,16 +593,17 @@ class FavHttp {
}
// (取消)收藏
static Future delFav({
List? ids,
static Future favVideo({
required String resources,
String? addIds,
String? delIds,
}) async {
var res = await Request().post(
Api.delFav,
Api.favVideo,
data: {
'resources': ids?.join(','),
'media_id': delIds,
'platform': 'web',
'resources': resources,
'add_media_ids': addIds ?? '',
'del_media_ids': delIds ?? '',
'csrf': Accounts.main.csrf,
},
options: Options(contentType: Headers.formUrlEncodedContentType),
@@ -615,19 +616,15 @@ class FavHttp {
}
// (取消)收藏
static Future favVideo({
int? aid,
String? addIds,
String? delIds,
int? type,
static Future unfavAll({
required rid,
required type,
}) async {
var res = await Request().post(
Api.favVideo,
Api.unfavAll,
data: {
'rid': aid,
'type': type ?? 2,
'add_media_ids': addIds ?? '',
'del_media_ids': delIds ?? '',
'rid': rid,
'type': type,
'csrf': Accounts.main.csrf,
},
options: Options(contentType: Headers.formUrlEncodedContentType),