mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-23 09:38:37 +00:00
feat: pugv (#927)
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
enum EpisodeType {
|
||||
part('分P'),
|
||||
season('合集'),
|
||||
pgc('番剧');
|
||||
pgc('剧集');
|
||||
|
||||
final String title;
|
||||
const EpisodeType(this.title);
|
||||
|
||||
@@ -10,11 +10,6 @@ enum HistoryBusinessType {
|
||||
// 文章
|
||||
article('article');
|
||||
|
||||
// 隐藏时长
|
||||
static const hiddenDurationType = {'live', 'article-list', 'article'};
|
||||
// 右上
|
||||
static const showBadge = {'pgc', 'article-list', 'article'};
|
||||
|
||||
final String type;
|
||||
const HistoryBusinessType(this.type);
|
||||
}
|
||||
|
||||
26
lib/models/common/video/video_type.dart
Normal file
26
lib/models/common/video/video_type.dart
Normal file
@@ -0,0 +1,26 @@
|
||||
import 'package:PiliPlus/http/api.dart';
|
||||
|
||||
enum VideoType {
|
||||
ugc(
|
||||
type: 3,
|
||||
api: Api.ugcUrl,
|
||||
),
|
||||
pgc(
|
||||
type: 4,
|
||||
api: Api.pgcUrl,
|
||||
),
|
||||
pugv(
|
||||
type: 10,
|
||||
replyType: 33,
|
||||
api: Api.pugvUrl,
|
||||
);
|
||||
|
||||
final int type;
|
||||
final String api;
|
||||
final int replyType;
|
||||
const VideoType({
|
||||
required this.api,
|
||||
required this.type,
|
||||
this.replyType = 1,
|
||||
});
|
||||
}
|
||||
@@ -170,23 +170,25 @@ abstract class BaseItem {
|
||||
|
||||
BaseItem.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
baseUrl = json['baseUrl'];
|
||||
final backupUrls = (json['backupUrl'] as List?)?.cast<String>() ?? [];
|
||||
baseUrl = json['baseUrl'] ?? json['base_url'];
|
||||
final backupUrls =
|
||||
((json['backupUrl'] ?? json['backup_url']) as List?)?.cast<String>() ??
|
||||
<String>[];
|
||||
backupUrl = backupUrls.isNotEmpty
|
||||
? backupUrls.firstWhere(
|
||||
(i) => !_isMCDNorPCDN(i),
|
||||
orElse: () => backupUrls.first,
|
||||
)
|
||||
: null;
|
||||
bandWidth = json['bandWidth'];
|
||||
bandWidth = json['bandWidth'] ?? json['bandwidth'];
|
||||
mimeType = json['mime_type'];
|
||||
codecs = json['codecs'];
|
||||
width = json['width'];
|
||||
height = json['height'];
|
||||
frameRate = json['frameRate'];
|
||||
frameRate = json['frameRate'] ?? json['frame_rate'];
|
||||
sar = json['sar'];
|
||||
startWithSap = json['startWithSap'];
|
||||
segmentBase = json['segmentBase'];
|
||||
startWithSap = json['startWithSap'] ?? json['start_with_sap'];
|
||||
segmentBase = json['segmentBase'] ?? json['segment_base'];
|
||||
codecid = json['codecid'];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user