feat: 新增长按删评论功能

This commit is contained in:
orz12
2024-04-22 20:08:27 +08:00
parent 6661967276
commit 65ce59984d
5 changed files with 106 additions and 40 deletions

View File

@@ -120,6 +120,10 @@ class Api {
// https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/comment/action.md
static const String replyAdd = '/x/v2/reply/add';
// 删除评论
// https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/comment/action.md
static const String replyDel = '/x/v2/reply/del';
// 用户(被)关注数、投稿数
// https://api.bilibili.com/x/relation/stat?vmid=697166795
static const String userStat = '/x/relation/stat';

View File

@@ -376,6 +376,25 @@ class VideoHttp {
}
}
static Future replyDel({
required int type,//replyType
required int oid,
required int rpid,
}) async {
var res = await Request().post(Api.replyDel, queryParameters: {
'type': type,//type.index
'oid': oid,
'rpid': rpid,
'csrf': await Request.getCsrf(),
});
log(res.toString());
if (res.data['code'] == 0) {
return {'status': true};
} else {
return {'status': false, 'msg': res.data['message']};
}
}
// 查询是否关注up
static Future hasFollow({required int mid}) async {
var res = await Request().get(Api.hasFollow, data: {'fid': mid});
@@ -584,14 +603,11 @@ class VideoHttp {
}
}
if (subtitlesVtt.isNotEmpty) {
subtitlesVtt.insert(0, {
'language': '',
'title': '关闭字幕',
'text': ""
});
subtitlesVtt.insert(0, {'language': '', 'title': '关闭字幕', 'text': ""});
}
return subtitlesVtt;
}
// 视频排行
static Future getRankVideoList(int rid) async {
try {