mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-01 00:28:18 +08:00
feat: get bangumi last play time
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -19,8 +19,8 @@ class Api {
|
|||||||
static const String videoUrl = '/x/player/wbi/playurl';
|
static const String videoUrl = '/x/player/wbi/playurl';
|
||||||
|
|
||||||
// 番剧视频流
|
// 番剧视频流
|
||||||
// https://api.bilibili.com/pgc/player/web/playurl?cid=104236640&bvid=BV13t411n7ex
|
// https://api.bilibili.com/pgc/player/web/v2/playurl?cid=104236640&bvid=BV13t411n7ex
|
||||||
static const String bangumiVideoUrl = '/pgc/player/web/playurl';
|
static const String bangumiVideoUrl = '/pgc/player/web/v2/playurl';
|
||||||
|
|
||||||
// 字幕
|
// 字幕
|
||||||
// aid, cid
|
// aid, cid
|
||||||
|
|||||||
@@ -195,20 +195,24 @@ class VideoHttp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 视频流
|
// 视频流
|
||||||
static Future videoUrl(
|
static Future videoUrl({
|
||||||
{int? avid, String? bvid, required int cid, int? qn}) async {
|
int? avid,
|
||||||
|
String? bvid,
|
||||||
|
required int cid,
|
||||||
|
int? qn,
|
||||||
|
dynamic epid,
|
||||||
|
dynamic seasonId,
|
||||||
|
}) async {
|
||||||
Map<String, dynamic> data = {
|
Map<String, dynamic> data = {
|
||||||
|
if (avid != null) 'avid': avid,
|
||||||
|
if (bvid != null) 'bvid': bvid,
|
||||||
|
if (epid != null) 'ep_id': epid,
|
||||||
|
if (seasonId != null) 'season_id': seasonId,
|
||||||
'cid': cid,
|
'cid': cid,
|
||||||
'qn': qn ?? 80,
|
'qn': qn ?? 80,
|
||||||
// 获取所有格式的视频
|
// 获取所有格式的视频
|
||||||
'fnval': 4048,
|
'fnval': 4048,
|
||||||
};
|
};
|
||||||
if (avid != null) {
|
|
||||||
data['avid'] = avid;
|
|
||||||
}
|
|
||||||
if (bvid != null) {
|
|
||||||
data['bvid'] = bvid;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 免登录查看1080p
|
// 免登录查看1080p
|
||||||
if ((GStorage.userInfo.get('userInfoCache') == null ||
|
if ((GStorage.userInfo.get('userInfoCache') == null ||
|
||||||
@@ -226,11 +230,21 @@ class VideoHttp {
|
|||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var res = await Request().get(Api.videoUrl, queryParameters: params);
|
var res = epid != null
|
||||||
|
? await Request().get(Api.bangumiVideoUrl, queryParameters: params)
|
||||||
|
: await Request().get(Api.videoUrl, queryParameters: params);
|
||||||
if (res.data['code'] == 0) {
|
if (res.data['code'] == 0) {
|
||||||
|
late PlayUrlModel data;
|
||||||
|
if (epid != null) {
|
||||||
|
data = PlayUrlModel.fromJson(res.data['result']['video_info'])
|
||||||
|
..lastPlayTime = res.data['result']['play_view_business_info']
|
||||||
|
['user_status']['watch_progress']['last_time'];
|
||||||
|
} else {
|
||||||
|
data = PlayUrlModel.fromJson(res.data['data']);
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
'status': true,
|
'status': true,
|
||||||
'data': PlayUrlModel.fromJson(res.data['data'])
|
'data': data,
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -551,6 +551,10 @@ class BangumiIntroController extends CommonController {
|
|||||||
scriptContent['props']['pageProps']['followState']['isFollowed'];
|
scriptContent['props']['pageProps']['followState']['isFollowed'];
|
||||||
followStatus.value =
|
followStatus.value =
|
||||||
scriptContent['props']['pageProps']['followState']['followStatus'];
|
scriptContent['props']['pageProps']['followState']['followStatus'];
|
||||||
|
// int progress = scriptContent['props']['pageProps']['dehydratedState']
|
||||||
|
// ['queries'][0]['state']['data']['result']
|
||||||
|
// ['play_view_business_info']['user_status']['watch_progress']
|
||||||
|
// ['current_watch_progress'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1078,7 +1078,12 @@ class VideoDetailController extends GetxController
|
|||||||
defaultValue: AudioQuality.k192.code);
|
defaultValue: AudioQuality.k192.code);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
var result = await VideoHttp.videoUrl(cid: cid.value, bvid: bvid);
|
var result = await VideoHttp.videoUrl(
|
||||||
|
cid: cid.value,
|
||||||
|
bvid: bvid,
|
||||||
|
epid: epId,
|
||||||
|
seasonId: seasonId,
|
||||||
|
);
|
||||||
if (result['status']) {
|
if (result['status']) {
|
||||||
data = result['data'];
|
data = result['data'];
|
||||||
if (enableSponsorBlock) {
|
if (enableSponsorBlock) {
|
||||||
|
|||||||
@@ -34,6 +34,14 @@ class Utils {
|
|||||||
|
|
||||||
static const channel = MethodChannel("pilipalax");
|
static const channel = MethodChannel("pilipalax");
|
||||||
|
|
||||||
|
static void showCopyTextDialog(text) {
|
||||||
|
Get.dialog(
|
||||||
|
AlertDialog(
|
||||||
|
content: SelectableText('$text'),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
static Future<dynamic> getWwebid(mid) async {
|
static Future<dynamic> getWwebid(mid) async {
|
||||||
try {
|
try {
|
||||||
dynamic response =
|
dynamic response =
|
||||||
|
|||||||
Reference in New Issue
Block a user