mod: cid获取

This commit is contained in:
guozhigq
2023-06-22 16:44:26 +08:00
parent 28e7980c47
commit 72361af269
5 changed files with 29 additions and 10 deletions

View File

@@ -154,4 +154,7 @@ class Api {
// 记录视频播放进度
// https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/video/report.md
static const String heartBeat = '/x/click-interface/web/heartbeat';
// 查询视频分P列表 (avid/bvid转cid)
static const String ab2c = '/x/player/pagelist';
}

View File

@@ -80,4 +80,15 @@ class SearchHttp {
};
}
}
static Future ab2c({int? aid, String? bvid}) async {
Map<String, dynamic> data = {};
if (aid != null) {
data['aid'] = aid;
} else if (bvid != null) {
data['bvid'] = bvid;
}
var res = await Request().get(Api.ab2c, data: {...data});
return res.data['data'].first['cid'];
}
}