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;
|
.body;
|
||||||
|
|
||||||
List<MVideo> a = [];
|
List<MVideo> a = [];
|
||||||
|
print(playerName);
|
||||||
if (playerName.contains("vido")) {
|
if (playerName.contains("vido")) {
|
||||||
videos.add(video
|
videos.add(video
|
||||||
..url = playerUrl
|
..url = playerUrl
|
||||||
..originalUrl = playerUrl
|
..originalUrl = playerUrl
|
||||||
..quality = "FRAnime (Vido)");
|
..quality = "FRAnime (Vido)");
|
||||||
} else if (playerName.contains("sendvid")) {
|
} else if (playerName.contains("sendvid")) {
|
||||||
a = await sendVidExtractor(
|
a = await sendVidExtractorr(playerUrl, "");
|
||||||
playerUrl, json.encode({"Referer": "https://franime.fr/"}), "");
|
|
||||||
} else if (playerName.contains("sibnet")) {
|
} else if (playerName.contains("sibnet")) {
|
||||||
a = await sibnetExtractor(playerUrl);
|
a = await sibnetExtractor(playerUrl);
|
||||||
}
|
}
|
||||||
@@ -335,6 +335,59 @@ class FrAnime extends MProvider {
|
|||||||
}
|
}
|
||||||
return "";
|
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) {
|
FrAnime main(MSource source) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import '../../../../../model/source.dart';
|
import '../../../../../model/source.dart';
|
||||||
|
|
||||||
Source get franimeSource => _franimeSource;
|
Source get franimeSource => _franimeSource;
|
||||||
const _franimeVersion = "0.0.7";
|
const _franimeVersion = "0.0.75";
|
||||||
const _franimeSourceCodeUrl =
|
const _franimeSourceCodeUrl =
|
||||||
"https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/src/fr/franime/franime.dart";
|
"https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/src/fr/franime/franime.dart";
|
||||||
Source _franimeSource = Source(
|
Source _franimeSource = Source(
|
||||||
|
|||||||
Reference in New Issue
Block a user