mod: 收藏夹跳转番剧

This commit is contained in:
guozhigq
2023-08-05 14:15:59 +08:00
parent d4cf67bbc7
commit 632900605b
4 changed files with 63 additions and 14 deletions

View File

@ -153,16 +153,20 @@ class VideoDetailData {
likeIcon = json["like_icon"];
needJumpBv = json["need_jump_bv"];
if (json['redirect_url'] != null) {
RegExp regex = RegExp(r'\d+');
Iterable<Match> matches = regex.allMatches(json['redirect_url']);
List<String> numbers = [];
for (Match match in matches) {
numbers.add(match.group(0)!);
}
epId = numbers[0];
epId = resolveEpId(json['redirect_url']);
}
}
String resolveEpId(url) {
RegExp regex = RegExp(r'\d+');
Iterable<Match> matches = regex.allMatches(url);
List<String> numbers = [];
for (Match match in matches) {
numbers.add(match.group(0)!);
}
return numbers[0];
}
Map<String, dynamic> toJson() => {
"bvid": bvid,
"aid": aid,