mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-01 08:38:18 +08:00
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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'],
|
||||
);
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user