mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
feat: live/article report
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -261,6 +261,11 @@ class Api {
|
||||
// https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/video/report.md
|
||||
static const String heartBeat = '/x/click-interface/web/heartbeat';
|
||||
|
||||
static const String historyReport = '/x/v2/history/report';
|
||||
|
||||
static const String roomEntryAction =
|
||||
'${HttpString.liveBaseUrl}/xlive/web-room/v1/index/roomEntryAction';
|
||||
|
||||
static const String mediaListHistory = '/x/v1/medialist/history';
|
||||
|
||||
// 查询视频分P列表 (avid/bvid转cid)
|
||||
|
||||
@@ -816,6 +816,32 @@ class VideoHttp {
|
||||
}
|
||||
}
|
||||
|
||||
static Future roomEntryAction({
|
||||
roomId,
|
||||
}) async {
|
||||
await Request().post(
|
||||
Api.roomEntryAction,
|
||||
queryParameters: {
|
||||
'csrf': await Request.getCsrf(),
|
||||
},
|
||||
data: {
|
||||
'room_id': roomId,
|
||||
'platform': 'pc',
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
static Future historyReport({
|
||||
aid,
|
||||
type,
|
||||
}) async {
|
||||
await Request().post(Api.historyReport, queryParameters: {
|
||||
if (aid != null) 'aid': aid,
|
||||
if (type != null) 'type': type,
|
||||
'csrf': Accounts.main.csrf,
|
||||
});
|
||||
}
|
||||
|
||||
// 视频播放进度
|
||||
static Future heartBeat({
|
||||
bvid,
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import 'package:PiliPlus/grpc/app/main/community/reply/v1/reply.pb.dart';
|
||||
import 'package:PiliPlus/http/dynamics.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/http/video.dart';
|
||||
import 'package:PiliPlus/models/dynamics/result.dart';
|
||||
import 'package:PiliPlus/pages/common/reply_controller.dart';
|
||||
import 'package:PiliPlus/pages/mine/controller.dart';
|
||||
import 'package:PiliPlus/utils/global_data.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:PiliPlus/utils/url_utils.dart';
|
||||
@@ -82,23 +84,28 @@ class HtmlRenderController extends ReplyController {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<LoadingState> customGetData() => GlobalData().grpcReply
|
||||
? ReplyHttp.replyListGrpc(
|
||||
type: type,
|
||||
oid: oid.value,
|
||||
cursor: CursorReq(
|
||||
next: cursor?.next ?? $fixnum.Int64(0),
|
||||
mode: mode.value,
|
||||
),
|
||||
antiGoodsReply: antiGoodsReply,
|
||||
)
|
||||
: ReplyHttp.replyList(
|
||||
isLogin: isLogin,
|
||||
oid: oid.value,
|
||||
nextOffset: nextOffset,
|
||||
type: type,
|
||||
sort: sortType.value.index,
|
||||
page: currentPage,
|
||||
antiGoodsReply: antiGoodsReply,
|
||||
);
|
||||
Future<LoadingState> customGetData() {
|
||||
if (Accounts.main.isLogin && !MineController.anonymity.value) {
|
||||
VideoHttp.historyReport(aid: oid.value, type: 5);
|
||||
}
|
||||
return GlobalData().grpcReply
|
||||
? ReplyHttp.replyListGrpc(
|
||||
type: type,
|
||||
oid: oid.value,
|
||||
cursor: CursorReq(
|
||||
next: cursor?.next ?? $fixnum.Int64(0),
|
||||
mode: mode.value,
|
||||
),
|
||||
antiGoodsReply: antiGoodsReply,
|
||||
)
|
||||
: ReplyHttp.replyList(
|
||||
isLogin: isLogin,
|
||||
oid: oid.value,
|
||||
nextOffset: nextOffset,
|
||||
type: type,
|
||||
sort: sortType.value.index,
|
||||
page: currentPage,
|
||||
antiGoodsReply: antiGoodsReply,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:PiliPlus/http/video.dart';
|
||||
import 'package:PiliPlus/models/live/danmu_info.dart';
|
||||
import 'package:PiliPlus/models/live/quality.dart';
|
||||
import 'package:PiliPlus/pages/mine/controller.dart';
|
||||
import 'package:PiliPlus/tcp/live.dart';
|
||||
import 'package:PiliPlus/utils/danmaku.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
@@ -41,6 +43,9 @@ class LiveRoomController extends GetxController {
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
roomId = int.parse(Get.parameters['roomid']!);
|
||||
if (Accounts.main.isLogin && !MineController.anonymity.value) {
|
||||
VideoHttp.roomEntryAction(roomId: roomId);
|
||||
}
|
||||
}
|
||||
|
||||
playerInit(source) async {
|
||||
|
||||
@@ -170,6 +170,8 @@ class AccountManager extends Interceptor {
|
||||
String url = err.requestOptions.uri.toString();
|
||||
debugPrint('🌹🌹ApiInterceptor: $url');
|
||||
if (url.contains('heartbeat') ||
|
||||
url.contains('history/report') ||
|
||||
url.contains('roomEntryAction') ||
|
||||
url.contains('seg.so') ||
|
||||
url.contains('online/total') ||
|
||||
url.contains('github') ||
|
||||
|
||||
Reference in New Issue
Block a user