feat: medialist: continue playing #70

Closes #70

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2024-12-31 20:33:03 +08:00
parent 098e2220cc
commit cde0ea244b
9 changed files with 260 additions and 166 deletions

View File

@@ -247,6 +247,8 @@ 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 mediaListHistory = '/x/v1/medialist/history';
// 查询视频分P列表 (avid/bvid转cid)
static const String ab2c = '/x/player/pagelist';

View File

@@ -137,7 +137,7 @@ class SearchHttp {
}
}
static Future<int> ab2c({int? aid, String? bvid}) async {
static Future<int> ab2c({dynamic aid, dynamic bvid}) async {
Map<String, dynamic> data = {};
if (aid != null) {
data['aid'] = aid;

View File

@@ -514,11 +514,12 @@ class UserHttp {
required dynamic type,
required int bizId,
required int ps,
int? oid,
dynamic oid,
int? otype,
bool withCurrent = false,
bool desc = true,
int sortField = 1,
dynamic sortField = 1,
bool direction = false,
}) async {
var res = await Request().get(
Api.mediaList,
@@ -529,7 +530,7 @@ class UserHttp {
if (oid != null) 'oid': oid,
if (otype != null) 'otype': otype, // video:2 // bangumi: 24
'ps': ps,
'direction': false,
'direction': direction,
'desc': desc,
'sort_field': sortField,
'tid': 0,

View File

@@ -755,6 +755,19 @@ class VideoHttp {
});
}
static Future medialistHistory({
required int desc,
required dynamic oid,
required dynamic upperMid,
}) async {
await Request().post(Api.mediaListHistory, queryParameters: {
'desc': desc,
'oid': oid,
'upper_mid': upperMid,
'csrf': await Request.getCsrf(),
});
}
// 添加追番
static Future bangumiAdd({int? seasonId}) async {
var res = await Request().post(Api.bangumiAdd, queryParameters: {