Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-08-30 14:50:54 +08:00
parent 80fa0240e9
commit 8d94c0405f
115 changed files with 3150 additions and 1438 deletions

View File

@@ -18,7 +18,7 @@ class DanmakuHttp {
int? fontsize, // 弹幕字号默认25
int? pool, // 弹幕池选择0普通池 1字幕池 2特殊池代码/BAS弹幕默认普通池0
//int? rnd,// 当前时间戳*1000000若无此项则发送弹幕冷却时间限制为90s若有此项则发送弹幕冷却时间限制为5s
bool? colorful, //60001专属渐变彩色需要会员
bool colorful = false, //60001专属渐变彩色需要会员
int? checkboxType, //是否带 UP 身份标识0普通4带有标识
// String? csrf,//CSRF Token位于 Cookie Cookie 方式必要
// String? access_key,// APP 登录 Token APP 方式必要
@@ -35,11 +35,11 @@ class DanmakuHttp {
//'aid': aid,
'bvid': bvid,
'progress': progress,
'color': colorful == true ? 16777215 : color,
'color': colorful ? 16777215 : color,
'fontsize': fontsize,
'pool': pool,
'rnd': DateTime.now().microsecondsSinceEpoch,
'colorful': colorful == true ? 60001 : null,
'colorful': colorful ? 60001 : null,
'checkbox_type': checkboxType,
'csrf': Accounts.main.csrf,
// 'access_key': access_key,

View File

@@ -166,7 +166,7 @@ class LiveHttp {
static Future<LoadingState<LiveIndexData>> liveFeedIndex({
required int pn,
required bool isLogin,
bool? moduleSelect,
bool moduleSelect = false,
}) async {
final params = {
'access_key': ?Accounts.main.accessKey,
@@ -182,7 +182,7 @@ class LiveHttp {
'fnval': 912,
'disable_rcmd': 0,
'https_url_req': 1,
if (moduleSelect == true) 'module_select': 1,
if (moduleSelect) 'module_select': 1,
'mobi_app': 'android',
'network': 'wifi',
'page': pn,

View File

@@ -5,7 +5,6 @@ import 'package:PiliPlus/http/loading_state.dart';
import 'package:PiliPlus/models_new/emote/data.dart';
import 'package:PiliPlus/models_new/emote/package.dart';
import 'package:PiliPlus/models_new/reply/data.dart';
import 'package:PiliPlus/models_new/reply/reply.dart';
import 'package:PiliPlus/models_new/reply2reply/data.dart';
import 'package:PiliPlus/utils/accounts.dart';
import 'package:PiliPlus/utils/accounts/account.dart';
@@ -24,8 +23,6 @@ class ReplyHttp {
required int type,
required int page,
int sort = 1,
required bool antiGoodsReply,
bool? enableFilter,
}) async {
var res = !isLogin
? await Request().get(
@@ -52,99 +49,19 @@ class ReplyHttp {
);
if (res.data['code'] == 0) {
ReplyData replyData = ReplyData.fromJson(res.data['data']);
// if (enableFilter != false && replyRegExp.pattern.isNotEmpty) {
// // topReplies
// if (replyData.topReplies?.isNotEmpty == true) {
// replyData.topReplies!.removeWhere((item) {
// bool hasMatch = replyRegExp.hasMatch(item.content?.message ?? '');
// // remove subreplies
// if (!hasMatch) {
// if (item.replies?.isNotEmpty == true) {
// item.replies!.removeWhere((item) =>
// replyRegExp.hasMatch(item.content?.message ?? ''));
// }
// }
// return hasMatch;
// });
// }
// // replies
// if (replyData.replies?.isNotEmpty == true) {
// replyData.replies!.removeWhere((item) {
// bool hasMatch = replyRegExp.hasMatch(item.content?.message ?? '');
// // remove subreplies
// if (!hasMatch) {
// if (item.replies?.isNotEmpty == true) {
// item.replies!.removeWhere((item) =>
// replyRegExp.hasMatch(item.content?.message ?? ''));
// }
// }
// return hasMatch;
// });
// }
// }
// // antiGoodsReply
// if (antiGoodsReply) {
// // topReplies
// if (replyData.topReplies?.isNotEmpty == true) {
// replyData.topReplies!.removeWhere((item) {
// bool hasMatch = needRemove(item);
// // remove subreplies
// if (!hasMatch) {
// if (item.replies?.isNotEmpty == true) {
// item.replies!.removeWhere(needRemove);
// }
// }
// return hasMatch;
// });
// }
// // replies
// if (replyData.replies?.isNotEmpty == true) {
// replyData.replies!.removeWhere((item) {
// bool hasMatch = needRemove(item);
// // remove subreplies
// if (!hasMatch) {
// if (item.replies?.isNotEmpty == true) {
// item.replies!.removeWhere(needRemove);
// }
// }
// return hasMatch;
// });
// }
// }
return Success(replyData);
} else {
return Error(res.data['message']);
}
}
static bool needRemove(ReplyItemModel reply) {
try {
if ((reply.content?.jumpUrl?.isNotEmpty == true &&
reply.content!.jumpUrl!.values.any((url) {
return url['extra'] != null &&
(url['extra']['goods_cm_control'] == 1 ||
url['extra']['goods_item_id'] != 0 ||
url['extra']['goods_prefetched_cache'].isNotEmpty);
})) ||
reply.content?.message?.contains(Constants.goodsUrlPrefix) == true) {
return true;
}
} catch (_) {}
return false;
}
static Future<LoadingState<ReplyReplyData>> replyReplyList({
required bool isLogin,
required int oid,
required int root,
required int pageNum,
required int type,
required bool antiGoodsReply,
bool? isCheck,
bool? filterBanWord,
bool isCheck = false,
}) async {
var res = await Request().get(
Api.replyReplyList,
@@ -160,21 +77,10 @@ class ReplyHttp {
);
if (res.data['code'] == 0) {
ReplyReplyData replyData = ReplyReplyData.fromJson(res.data['data']);
// if (filterBanWord != false && replyRegExp.pattern.isNotEmpty) {
// if (replyData.replies?.isNotEmpty == true) {
// replyData.replies!.removeWhere(
// (item) => replyRegExp.hasMatch(item.content?.message ?? ''));
// }
// }
// if (antiGoodsReply) {
// if (replyData.replies?.isNotEmpty == true) {
// replyData.replies!.removeWhere(needRemove);
// }
// }
return Success(replyData);
} else {
return Error(
isCheck == true
isCheck
? '${res.data['code']}${res.data['message']}'
: res.data['message'],
);

View File

@@ -525,7 +525,7 @@ class VideoHttp {
int? root,
int? parent,
List? pictures,
bool? syncToDynamic,
bool syncToDynamic = false,
Map<String, int>? atNameToMid,
}) async {
if (message == '') {
@@ -540,7 +540,7 @@ class VideoHttp {
if (atNameToMid?.isNotEmpty == true)
'at_name_to_mid': jsonEncode(atNameToMid), // {"name":uid}
if (pictures != null) 'pictures': jsonEncode(pictures),
if (syncToDynamic == true) 'sync_to_dynamic': 1,
if (syncToDynamic) 'sync_to_dynamic': 1,
'csrf': Accounts.main.csrf,
};
var res = await Request().post(