64 lines
1.4 KiB
Dart
64 lines
1.4 KiB
Dart
import 'package:equatable/equatable.dart';
|
|
|
|
class Video extends Equatable {
|
|
Video({
|
|
this.id = '',
|
|
this.url = '',
|
|
this.extractor = '',
|
|
this.isParsed = false,
|
|
this.status = 'pending',
|
|
this.format = 'MP4 HD',
|
|
this.title = '',
|
|
this.thumbnail = '',
|
|
this.description = '',
|
|
this.duration = '0:00',
|
|
this.uploader = '',
|
|
this.uploadDate = '',
|
|
this.filename = '',
|
|
});
|
|
|
|
String id;
|
|
String url;
|
|
String extractor;
|
|
bool isParsed;
|
|
String status;
|
|
String format;
|
|
String title;
|
|
String thumbnail;
|
|
String description;
|
|
String duration;
|
|
String uploader;
|
|
String uploadDate;
|
|
String filename;
|
|
|
|
factory Video.fromJson(Map<String, dynamic> json) {
|
|
return Video(
|
|
id: json['id'],
|
|
isParsed: true,
|
|
url: json['url'] ?? json['original_url'],
|
|
extractor: json['extractor_key'] ?? '',
|
|
title: json['title'],
|
|
thumbnail: json['thumbnails']![0]['url'],
|
|
description: json['description'] ?? '',
|
|
duration: json['duration_string'] ?? '0:00',
|
|
uploader: json['uploader'] ?? '',
|
|
uploadDate: json['upload_date'] ?? '');
|
|
}
|
|
|
|
@override
|
|
List<Object> get props => [
|
|
id,
|
|
title,
|
|
thumbnail,
|
|
description,
|
|
duration,
|
|
uploader,
|
|
uploadDate,
|
|
format,
|
|
status,
|
|
url,
|
|
isParsed,
|
|
filename,
|
|
];
|
|
}
|