mod: 包月充电视频异常处理(部分)

This commit is contained in:
orz12
2024-01-24 21:30:42 +08:00
parent 8e6eba4139
commit 12a8226de0
2 changed files with 58 additions and 2 deletions

View File

@@ -52,7 +52,15 @@ class PlayUrlModel {
videoCodecid = json['video_codecid'];
seekParam = json['seek_param'];
seekType = json['seek_type'];
dash = Dash.fromJson(json['dash']);
if (json['dash'] != null) {
dash = Dash.fromJson(json['dash']);
} else if (json['durl'] != null) {
//试看的充电包月视频可能出现没有dash只有durl的情况
var durlList = json['durl']
.map<Durl>((e) => Durl.fromJson(e))
.toList();
//TODO
}
supportFormats = json['support_formats'] != null
? json['support_formats']
.map<FormatItem>((e) => FormatItem.fromJson(e))
@@ -92,6 +100,40 @@ class Dash {
}
}
class Durl {
int? order;
int? length;
int? size;
String? ahead;
String? vhead;
String? url;
List<String>? backupUrl;
Durl({
this.order,
this.length,
this.size,
this.ahead,
this.vhead,
this.url,
this.backupUrl,
});
factory Durl.fromJson(Map<String, dynamic> json) {
return Durl(
order: json['order'],
length: json['length'],
size: json['size'],
ahead: json['ahead'],
vhead: json['vhead'],
url: json['url'],
backupUrl: json['backup_url'] != null
? List<String>.from(json['backup_url'])
: [],
);
}
}
class VideoItem {
VideoItem({
this.id,