opt handle res

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-05-29 17:17:35 +08:00
parent b643cb1bd0
commit 924d51d41b
198 changed files with 3715 additions and 2001 deletions

View File

@@ -0,0 +1,93 @@
import 'package:PiliPlus/models/model_owner.dart';
import 'package:PiliPlus/models/video_detail/dimension.dart';
import 'package:PiliPlus/models/video_detail/rights.dart';
import 'package:PiliPlus/models/video_detail/stat.dart';
class Arc {
int? aid;
int? videos;
int? typeId;
String? typeName;
int? copyright;
String? pic;
String? title;
int? pubdate;
int? ctime;
String? desc;
int? state;
int? duration;
Rights? rights;
Owner? author;
Stat? stat;
String? dynam1c;
Dimension? dimension;
bool? isChargeableSeason;
bool? isBlooper;
int? enableVt;
String? vtDisplay;
int? typeIdV2;
String? typeNameV2;
int? isLessonVideo;
Arc({
this.aid,
this.videos,
this.typeId,
this.typeName,
this.copyright,
this.pic,
this.title,
this.pubdate,
this.ctime,
this.desc,
this.state,
this.duration,
this.rights,
this.author,
this.stat,
this.dynam1c,
this.dimension,
this.isChargeableSeason,
this.isBlooper,
this.enableVt,
this.vtDisplay,
this.typeIdV2,
this.typeNameV2,
this.isLessonVideo,
});
factory Arc.fromJson(Map<String, dynamic> json) => Arc(
aid: json['aid'] as int?,
videos: json['videos'] as int?,
typeId: json['type_id'] as int?,
typeName: json['type_name'] as String?,
copyright: json['copyright'] as int?,
pic: json['pic'] as String?,
title: json['title'] as String?,
pubdate: json['pubdate'] as int?,
ctime: json['ctime'] as int?,
desc: json['desc'] as String?,
state: json['state'] as int?,
duration: json['duration'] as int?,
rights: json['rights'] == null
? null
: Rights.fromJson(json['rights'] as Map<String, dynamic>),
author: json['author'] == null
? null
: Owner.fromJson(json['author'] as Map<String, dynamic>),
stat: json['stat'] == null
? null
: Stat.fromJson(json['stat'] as Map<String, dynamic>),
dynam1c: json['dynamic'] as String?,
dimension: json['dimension'] == null
? null
: Dimension.fromJson(json['dimension'] as Map<String, dynamic>),
isChargeableSeason: json['is_chargeable_season'] as bool?,
isBlooper: json['is_blooper'] as bool?,
enableVt: json['enable_vt'] as int?,
vtDisplay: json['vt_display'] as String?,
typeIdV2: json['type_id_v2'] as int?,
typeNameV2: json['type_name_v2'] as String?,
isLessonVideo: json['is_lesson_video'] as int?,
);
}

View File

@@ -0,0 +1,13 @@
class ArgueInfo {
String? argueMsg;
int? argueType;
String? argueLink;
ArgueInfo({this.argueMsg, this.argueType, this.argueLink});
factory ArgueInfo.fromJson(Map<String, dynamic> json) => ArgueInfo(
argueMsg: json['argue_msg'] as String?,
argueType: json['argue_type'] as int?,
argueLink: json['argue_link'] as String?,
);
}

View File

@@ -0,0 +1,187 @@
import 'package:PiliPlus/models/video_detail/argue_info.dart';
import 'package:PiliPlus/models/video_detail/desc_v2.dart';
import 'package:PiliPlus/models/video_detail/dimension.dart';
import 'package:PiliPlus/models/video_detail/owner.dart';
import 'package:PiliPlus/models/video_detail/page.dart';
import 'package:PiliPlus/models/video_detail/rights.dart';
import 'package:PiliPlus/models/video_detail/staff.dart';
import 'package:PiliPlus/models/video_detail/stat.dart';
import 'package:PiliPlus/models/video_detail/subtitle.dart';
import 'package:PiliPlus/models/video_detail/ugc_season.dart';
import 'package:PiliPlus/models/video_detail/user_garb.dart';
import 'package:PiliPlus/utils/app_scheme.dart';
class VideoDetailData {
String? bvid;
int? aid;
int? videos;
int? tid;
int? tidV2;
String? tname;
String? tnameV2;
int? copyright;
String? pic;
String? title;
int? pubdate;
int? ctime;
String? desc;
List<DescV2>? descV2;
int? state;
int? duration;
Rights? rights;
Owner? owner;
Stat? stat;
ArgueInfo? argueInfo;
String? dynam1c;
int? cid;
Dimension? dimension;
int? seasonId;
int? teenageMode;
bool? isChargeableSeason;
bool? isStory;
bool? isUpowerExclusive;
bool? isUpowerPlay;
bool? isUpowerPreview;
int? enableVt;
String? vtDisplay;
bool? isUpowerExclusiveWithQa;
bool? noCache;
List<Part>? pages;
Subtitle? subtitle;
UgcSeason? ugcSeason;
bool? isSeasonDisplay;
UserGarb? userGarb;
String? likeIcon;
bool? needJumpBv;
bool? disableShowUpInfo;
int? isStoryPlay;
bool? isViewSelf;
String? epId;
List<Staff>? staff;
bool isPageReversed = false;
VideoDetailData({
this.bvid,
this.aid,
this.videos,
this.tid,
this.tidV2,
this.tname,
this.tnameV2,
this.copyright,
this.pic,
this.title,
this.pubdate,
this.ctime,
this.desc,
this.descV2,
this.state,
this.duration,
this.rights,
this.owner,
this.stat,
this.argueInfo,
this.dynam1c,
this.cid,
this.dimension,
this.seasonId,
this.teenageMode,
this.isChargeableSeason,
this.isStory,
this.isUpowerExclusive,
this.isUpowerPlay,
this.isUpowerPreview,
this.enableVt,
this.vtDisplay,
this.isUpowerExclusiveWithQa,
this.noCache,
this.pages,
this.subtitle,
this.ugcSeason,
this.isSeasonDisplay,
this.userGarb,
this.likeIcon,
this.needJumpBv,
this.disableShowUpInfo,
this.isStoryPlay,
this.isViewSelf,
this.epId,
this.staff,
});
factory VideoDetailData.fromJson(Map<String, dynamic> json) =>
VideoDetailData(
bvid: json['bvid'] as String?,
aid: json['aid'] as int?,
videos: json['videos'] as int?,
tid: json['tid'] as int?,
tidV2: json['tid_v2'] as int?,
tname: json['tname'] as String?,
tnameV2: json['tname_v2'] as String?,
copyright: json['copyright'] as int?,
pic: json['pic'] as String?,
title: json['title'] as String?,
pubdate: json['pubdate'] as int?,
ctime: json['ctime'] as int?,
desc: json['desc'] as String?,
descV2: (json['desc_v2'] as List<dynamic>?)
?.map((e) => DescV2.fromJson(e as Map<String, dynamic>))
.toList(),
state: json['state'] as int?,
duration: json['duration'] as int?,
rights: json['rights'] == null
? null
: Rights.fromJson(json['rights'] as Map<String, dynamic>),
owner: json['owner'] == null
? null
: Owner.fromJson(json['owner'] as Map<String, dynamic>),
stat: json['stat'] == null
? null
: Stat.fromJson(json['stat'] as Map<String, dynamic>),
argueInfo: json['argue_info'] == null
? null
: ArgueInfo.fromJson(json['argue_info'] as Map<String, dynamic>),
dynam1c: json['dynamic'] as String?,
cid: json['cid'] as int?,
dimension: json['dimension'] == null
? null
: Dimension.fromJson(json['dimension'] as Map<String, dynamic>),
seasonId: json['season_id'] as int?,
teenageMode: json['teenage_mode'] as int?,
isChargeableSeason: json['is_chargeable_season'] as bool?,
isStory: json['is_story'] as bool?,
isUpowerExclusive: json['is_upower_exclusive'] as bool?,
isUpowerPlay: json['is_upower_play'] as bool?,
isUpowerPreview: json['is_upower_preview'] as bool?,
enableVt: json['enable_vt'] as int?,
vtDisplay: json['vt_display'] as String?,
isUpowerExclusiveWithQa: json['is_upower_exclusive_with_qa'] as bool?,
noCache: json['no_cache'] as bool?,
pages: (json['pages'] as List<dynamic>?)
?.map((e) => Part.fromJson(e as Map<String, dynamic>))
.toList(),
subtitle: json['subtitle'] == null
? null
: Subtitle.fromJson(json['subtitle'] as Map<String, dynamic>),
ugcSeason: json['ugc_season'] == null
? null
: UgcSeason.fromJson(json['ugc_season'] as Map<String, dynamic>),
isSeasonDisplay: json['is_season_display'] as bool?,
userGarb: json['user_garb'] == null
? null
: UserGarb.fromJson(json['user_garb'] as Map<String, dynamic>),
likeIcon: json['like_icon'] as String?,
needJumpBv: json['need_jump_bv'] as bool?,
disableShowUpInfo: json['disable_show_up_info'] as bool?,
isStoryPlay: json['is_story_play'] as int?,
isViewSelf: json['is_view_self'] as bool?,
staff: (json["staff"] as List?)
?.map((item) => Staff.fromJson(item))
.toList(),
epId: json['redirect_url'] == null
? null
: PiliScheme.uriDigitRegExp
.firstMatch(json['redirect_url'])
?.group(1),
);
}

View File

@@ -0,0 +1,13 @@
class DescV2 {
String? rawText;
int? type;
int? bizId;
DescV2({this.rawText, this.type, this.bizId});
factory DescV2.fromJson(Map<String, dynamic> json) => DescV2(
rawText: json['raw_text'] as String?,
type: json['type'] as int?,
bizId: json['biz_id'] as int?,
);
}

View File

@@ -0,0 +1,13 @@
class Dimension {
int? width;
int? height;
int? rotate;
Dimension({this.width, this.height, this.rotate});
factory Dimension.fromJson(Map<String, dynamic> json) => Dimension(
width: json['width'] as int?,
height: json['height'] as int?,
rotate: json['rotate'] as int?,
);
}

View File

@@ -0,0 +1,53 @@
import 'package:PiliPlus/models/video_detail/arc.dart';
import 'package:PiliPlus/models/video_detail/page.dart';
class EpisodeItem {
int? seasonId;
int? sectionId;
int? id;
int? aid;
int? cid;
String? title;
int? attribute;
Arc? arc;
Part? page;
String? bvid;
List<Part>? pages;
String? badge;
EpisodeItem({
this.seasonId,
this.sectionId,
this.id,
this.aid,
this.cid,
this.title,
this.attribute,
this.arc,
this.page,
this.bvid,
this.pages,
this.badge,
});
factory EpisodeItem.fromJson(Map<String, dynamic> json) => EpisodeItem(
seasonId: json['season_id'] as int?,
sectionId: json['section_id'] as int?,
id: json['id'] as int?,
aid: json['aid'] as int?,
cid: json['cid'] as int?,
title: json['title'] as String?,
attribute: json['attribute'] as int?,
arc: json['arc'] == null
? null
: Arc.fromJson(json['arc'] as Map<String, dynamic>),
page: json['page'] == null
? null
: Part.fromJson(json['page'] as Map<String, dynamic>),
bvid: json['bvid'] as String?,
pages: (json['pages'] as List<dynamic>?)
?.map((e) => Part.fromJson(e as Map<String, dynamic>))
.toList(),
badge: json['badge'],
);
}

View File

@@ -0,0 +1,13 @@
class HonorReply {
HonorReply();
factory HonorReply.fromJson(Map<String, dynamic> json) {
// TODO: implement fromJson
throw UnimplementedError('HonorReply.fromJson($json) is not implemented');
}
Map<String, dynamic> toJson() {
// TODO: implement toJson
throw UnimplementedError();
}
}

View File

@@ -0,0 +1,19 @@
class Owner {
int? mid;
String? name;
String? face;
Owner({this.mid, this.name, this.face});
factory Owner.fromJson(Map<String, dynamic> json) => Owner(
mid: json['mid'] as int?,
name: json['name'] as String?,
face: json['face'] as String?,
);
Map<String, dynamic> toJson() => {
'mid': mid,
'name': name,
'face': face,
};
}

View File

@@ -0,0 +1,45 @@
import 'package:PiliPlus/models/video_detail/dimension.dart';
class Part {
int? cid;
int? page;
String? from;
String? pagePart;
int? duration;
String? vid;
String? weblink;
Dimension? dimension;
int? ctime;
String? firstFrame;
String? badge;
Part({
this.cid,
this.page,
this.from,
this.pagePart,
this.duration,
this.vid,
this.weblink,
this.dimension,
this.ctime,
this.firstFrame,
this.badge,
});
factory Part.fromJson(Map<String, dynamic> json) => Part(
cid: json['cid'] as int?,
page: json['page'] as int?,
from: json['from'] as String?,
pagePart: json['part'] as String?,
duration: json['duration'] as int?,
vid: json['vid'] as String?,
weblink: json['weblink'] as String?,
dimension: json['dimension'] == null
? null
: Dimension.fromJson(json['dimension'] as Map<String, dynamic>),
ctime: json['ctime'] as int?,
firstFrame: json['first_frame'] as String?,
badge: json["badge"],
);
}

View File

@@ -0,0 +1,62 @@
class Rights {
int? bp;
int? elec;
int? download;
int? movie;
int? pay;
int? hd5;
int? noReprint;
int? autoplay;
int? ugcPay;
int? isCooperation;
int? ugcPayPreview;
int? noBackground;
int? cleanMode;
int? isSteinGate;
int? is360;
int? noShare;
int? arcPay;
int? freeWatch;
Rights({
this.bp,
this.elec,
this.download,
this.movie,
this.pay,
this.hd5,
this.noReprint,
this.autoplay,
this.ugcPay,
this.isCooperation,
this.ugcPayPreview,
this.noBackground,
this.cleanMode,
this.isSteinGate,
this.is360,
this.noShare,
this.arcPay,
this.freeWatch,
});
factory Rights.fromJson(Map<String, dynamic> json) => Rights(
bp: json['bp'] as int?,
elec: json['elec'] as int?,
download: json['download'] as int?,
movie: json['movie'] as int?,
pay: json['pay'] as int?,
hd5: json['hd5'] as int?,
noReprint: json['no_reprint'] as int?,
autoplay: json['autoplay'] as int?,
ugcPay: json['ugc_pay'] as int?,
isCooperation: json['is_cooperation'] as int?,
ugcPayPreview: json['ugc_pay_preview'] as int?,
noBackground: json['no_background'] as int?,
cleanMode: json['clean_mode'] as int?,
isSteinGate: json['is_stein_gate'] as int?,
is360: json['is_360'] as int?,
noShare: json['no_share'] as int?,
arcPay: json['arc_pay'] as int?,
freeWatch: json['free_watch'] as int?,
);
}

View File

@@ -0,0 +1,22 @@
import 'package:PiliPlus/models/video_detail/episode.dart';
class SectionItem {
int? seasonId;
int? id;
String? title;
int? type;
List<EpisodeItem>? episodes;
bool isReversed = false;
SectionItem({this.seasonId, this.id, this.title, this.type, this.episodes});
factory SectionItem.fromJson(Map<String, dynamic> json) => SectionItem(
seasonId: json['season_id'] as int?,
id: json['id'] as int?,
title: json['title'] as String?,
type: json['type'] as int?,
episodes: (json['episodes'] as List<dynamic>?)
?.map((e) => EpisodeItem.fromJson(e as Map<String, dynamic>))
.toList(),
);
}

View File

@@ -0,0 +1,29 @@
import 'package:PiliPlus/models/model_avatar.dart';
class Staff {
dynamic mid;
String? title;
String? name;
String? face;
Vip? vip;
BaseOfficialVerify? official;
Staff({
this.mid,
this.title,
this.name,
this.face,
this.vip,
});
Staff.fromJson(Map<String, dynamic> json) {
mid = json["mid"];
title = json["title"];
name = json["name"];
face = json["face"];
vip = json["vip"] == null ? null : Vip.fromJson(json["vip"]);
official = json['official'] == null
? null
: BaseOfficialVerify.fromJson(json['official']);
}
}

View File

@@ -0,0 +1,47 @@
class Stat {
int? aid;
int? view;
int? danmaku;
int? reply;
int? favorite;
int? coin;
int? share;
int? nowRank;
int? hisRank;
int? like;
int? dislike;
String? evaluation;
int? vt;
Stat({
this.aid,
this.view,
this.danmaku,
this.reply,
this.favorite,
this.coin,
this.share,
this.nowRank,
this.hisRank,
this.like,
this.dislike,
this.evaluation,
this.vt,
});
factory Stat.fromJson(Map<String, dynamic> json) => Stat(
aid: json['aid'] as int?,
view: json['view'] as int?,
danmaku: json['danmaku'] as int?,
reply: json['reply'] as int?,
favorite: json['favorite'] as int?,
coin: json['coin'] as int?,
share: json['share'] as int?,
nowRank: json['now_rank'] as int?,
hisRank: json['his_rank'] as int?,
like: json['like'] as int?,
dislike: json['dislike'] as int?,
evaluation: json['evaluation'] as String?,
vt: json['vt'] as int?,
);
}

View File

@@ -0,0 +1,11 @@
class Subtitle {
bool? allowSubmit;
List<dynamic>? list;
Subtitle({this.allowSubmit, this.list});
factory Subtitle.fromJson(Map<String, dynamic> json) => Subtitle(
allowSubmit: json['allow_submit'] as bool?,
list: json['list'] as List<dynamic>?,
);
}

View File

@@ -0,0 +1,54 @@
import 'package:PiliPlus/models/video_detail/section.dart';
import 'package:PiliPlus/models/video_detail/stat.dart';
class UgcSeason {
int? id;
String? title;
String? cover;
int? mid;
String? intro;
int? signState;
int? attribute;
List<SectionItem>? sections;
Stat? stat;
int? epCount;
int? seasonType;
bool? isPaySeason;
int? enableVt;
UgcSeason({
this.id,
this.title,
this.cover,
this.mid,
this.intro,
this.signState,
this.attribute,
this.sections,
this.stat,
this.epCount,
this.seasonType,
this.isPaySeason,
this.enableVt,
});
factory UgcSeason.fromJson(Map<String, dynamic> json) => UgcSeason(
id: json['id'] as int?,
title: json['title'] as String?,
cover: json['cover'] as String?,
mid: json['mid'] as int?,
intro: json['intro'] as String?,
signState: json['sign_state'] as int?,
attribute: json['attribute'] as int?,
sections: (json['sections'] as List<dynamic>?)
?.map((e) => SectionItem.fromJson(e as Map<String, dynamic>))
.toList(),
stat: json['stat'] == null
? null
: Stat.fromJson(json['stat'] as Map<String, dynamic>),
epCount: json['ep_count'] as int?,
seasonType: json['season_type'] as int?,
isPaySeason: json['is_pay_season'] as bool?,
enableVt: json['enable_vt'] as int?,
);
}

View File

@@ -0,0 +1,9 @@
class UserGarb {
String? urlImageAniCut;
UserGarb({this.urlImageAniCut});
factory UserGarb.fromJson(Map<String, dynamic> json) => UserGarb(
urlImageAniCut: json['url_image_ani_cut'] as String?,
);
}

View File

@@ -0,0 +1,21 @@
import 'package:PiliPlus/models/video_detail/data.dart';
class VideoDetailResponse {
int? code;
String? message;
int? ttl;
VideoDetailData? data;
VideoDetailResponse({this.code, this.message, this.ttl, this.data});
factory VideoDetailResponse.fromJson(Map<String, dynamic> json) {
return VideoDetailResponse(
code: json['code'] as int?,
message: json['message'] as String?,
ttl: json['ttl'] as int?,
data: json['data'] == null
? null
: VideoDetailData.fromJson(json['data'] as Map<String, dynamic>),
);
}
}