feat: 同时在看人数

This commit is contained in:
guozhigq
2023-08-24 08:38:01 +08:00
parent b67127123a
commit 201422c150
7 changed files with 81 additions and 0 deletions

View File

@ -288,4 +288,8 @@ class Api {
// github 获取最新版
static const String latestApp =
'https://api.github.com/repos/guozhigq/pilipala/releases/latest';
// 多少人在看
// https://api.bilibili.com/x/player/online/total?aid=913663681&cid=1203559746&bvid=BV1MM4y1s7NZ&ts=56427838
static const String onlineTotal = '/x/player/online/total';
}

View File

@ -399,4 +399,16 @@ class VideoHttp {
return {'status': false, 'msg': res.data['result']['toast']};
}
}
// 查看视频同时在看人数
static Future onlineTotal({int? aid, String? bvid, int? cid}) async {
var res = await Request().get(Api.onlineTotal, data: {
'aid': aid,
'bvid': bvid,
'cid': cid,
});
if (res.data['code'] == 0) {
return {'status': true, 'data': res.data['data']};
}
}
}