mirror of
https://github.com/kodjodevf/mangayomi-extensions.git
synced 2026-02-14 10:51:17 +00:00
FrAnime: fix player
This commit is contained in:
@@ -146,14 +146,14 @@ class FrAnime extends MProvider {
|
||||
.body;
|
||||
|
||||
List<MVideo> a = [];
|
||||
print(playerName);
|
||||
if (playerName.contains("vido")) {
|
||||
videos.add(video
|
||||
..url = playerUrl
|
||||
..originalUrl = playerUrl
|
||||
..quality = "FRAnime (Vido)");
|
||||
} else if (playerName.contains("sendvid")) {
|
||||
a = await sendVidExtractor(
|
||||
playerUrl, json.encode({"Referer": "https://franime.fr/"}), "");
|
||||
a = await sendVidExtractorr(playerUrl, "");
|
||||
} else if (playerName.contains("sibnet")) {
|
||||
a = await sibnetExtractor(playerUrl);
|
||||
}
|
||||
@@ -335,6 +335,59 @@ class FrAnime extends MProvider {
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
Future<List<MVideo>> sendVidExtractorr(String url, String prefix) async {
|
||||
final res = (await client.get(Uri.parse(url))).body;
|
||||
final document = parseHtml(res);
|
||||
final masterUrl = document.selectFirst("source#video_source")?.attr("src");
|
||||
if (masterUrl == null) return [];
|
||||
final masterHeaders = {
|
||||
"Accept": "*/*",
|
||||
"Host": Uri.parse(masterUrl).host,
|
||||
"Origin": "https://${Uri.parse(url).host}",
|
||||
"Referer": "https://${Uri.parse(url).host}/",
|
||||
};
|
||||
List<MVideo> videos = [];
|
||||
if (masterUrl.contains(".m3u8")) {
|
||||
final masterPlaylistRes = (await client.get(Uri.parse(masterUrl))).body;
|
||||
|
||||
for (var it in substringAfter(masterPlaylistRes, "#EXT-X-STREAM-INF:")
|
||||
.split("#EXT-X-STREAM-INF:")) {
|
||||
final quality =
|
||||
"${substringBefore(substringBefore(substringAfter(substringAfter(it, "RESOLUTION="), "x"), ","), "\n")}p";
|
||||
|
||||
String videoUrl = substringBefore(substringAfter(it, "\n"), "\n");
|
||||
|
||||
if (!videoUrl.startsWith("http")) {
|
||||
videoUrl =
|
||||
"${masterUrl.split("/").sublist(0, masterUrl.split("/").length - 1).join("/")}/$videoUrl";
|
||||
}
|
||||
final videoHeaders = {
|
||||
"Accept": "*/*",
|
||||
"Host": Uri.parse(videoUrl).host,
|
||||
"Origin": "https://${Uri.parse(url).host}",
|
||||
"Referer": "https://${Uri.parse(url).host}/",
|
||||
};
|
||||
var video = MVideo();
|
||||
video
|
||||
..url = videoUrl
|
||||
..originalUrl = videoUrl
|
||||
..quality = prefix + "Sendvid:$quality"
|
||||
..headers = videoHeaders;
|
||||
videos.add(video);
|
||||
}
|
||||
} else {
|
||||
var video = MVideo();
|
||||
video
|
||||
..url = masterUrl
|
||||
..originalUrl = masterUrl
|
||||
..quality = prefix + "Sendvid:default"
|
||||
..headers = masterHeaders;
|
||||
videos.add(video);
|
||||
}
|
||||
|
||||
return videos;
|
||||
}
|
||||
}
|
||||
|
||||
FrAnime main(MSource source) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import '../../../../../model/source.dart';
|
||||
|
||||
Source get franimeSource => _franimeSource;
|
||||
const _franimeVersion = "0.0.7";
|
||||
const _franimeVersion = "0.0.75";
|
||||
const _franimeSourceCodeUrl =
|
||||
"https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/src/fr/franime/franime.dart";
|
||||
Source _franimeSource = Source(
|
||||
|
||||
Reference in New Issue
Block a user