mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-15 23:10:09 +08:00
@@ -242,24 +242,27 @@ abstract final class VideoHttp {
|
||||
if (res.data['code'] == 0) {
|
||||
late PlayUrlModel data;
|
||||
switch (videoType) {
|
||||
case VideoType.ugc:
|
||||
case .ugc:
|
||||
data = PlayUrlModel.fromJson(res.data['data']);
|
||||
break;
|
||||
case VideoType.pugv:
|
||||
final result = res.data['data'];
|
||||
data = PlayUrlModel.fromJson(result)
|
||||
..lastPlayTime =
|
||||
result?['play_view_business_info']?['user_status']?['watch_progress']?['current_watch_progress'];
|
||||
break;
|
||||
case VideoType.pgc:
|
||||
|
||||
case .pgc:
|
||||
final result = res.data['result'];
|
||||
data = PlayUrlModel.fromJson(result['video_info'])
|
||||
..lastPlayTime =
|
||||
result?['play_view_business_info']?['user_status']?['watch_progress']?['current_watch_progress'];
|
||||
break;
|
||||
data = PlayUrlModel.fromJson(result['video_info']);
|
||||
if (result['play_view_business_info']?['user_status']?['watch_progress']?['current_watch_progress']
|
||||
case final int progress when progress > 0) {
|
||||
data.lastPlayTime = progress;
|
||||
}
|
||||
|
||||
case .pugv:
|
||||
final result = res.data['data'];
|
||||
data = PlayUrlModel.fromJson(result);
|
||||
if (result['play_view_business_info']?['user_status']?['watch_progress']?['current_watch_progress']
|
||||
case final int progress when progress > 0) {
|
||||
data.lastPlayTime = progress;
|
||||
}
|
||||
}
|
||||
return Success(data);
|
||||
} else if (epid != null && videoType == VideoType.ugc) {
|
||||
} else if (epid != null && videoType == .ugc) {
|
||||
return await videoUrl(
|
||||
avid: avid,
|
||||
bvid: bvid,
|
||||
@@ -268,7 +271,7 @@ abstract final class VideoHttp {
|
||||
epid: epid,
|
||||
seasonId: seasonId,
|
||||
tryLook: tryLook,
|
||||
videoType: VideoType.pgc,
|
||||
videoType: .pgc,
|
||||
);
|
||||
}
|
||||
return Error(_parseVideoErr(res.data['code'], res.data['message']));
|
||||
|
||||
@@ -69,7 +69,9 @@ class PlayUrlModel {
|
||||
?.map<FormatItem>((e) => FormatItem.fromJson(e))
|
||||
.toList();
|
||||
volume = json['volume'] == null ? null : Volume.fromJson(json['volume']);
|
||||
lastPlayTime = json['last_play_time'];
|
||||
if (json['last_play_time'] case final int progress when progress > 0) {
|
||||
lastPlayTime = progress;
|
||||
}
|
||||
lastPlayCid = json['last_play_cid'];
|
||||
curLanguage = json['cur_language'];
|
||||
language = json['language'] == null
|
||||
|
||||
Reference in New Issue
Block a user