mirror of
https://github.com/kodjodevf/mangayomi-extensions.git
synced 2026-02-14 10:51:17 +00:00
add novel support
This commit is contained in:
@@ -10,7 +10,9 @@ import 'src/en/animepahe/source.dart';
|
||||
import 'src/en/dramacool/source.dart';
|
||||
import 'src/en/gogoanime/source.dart';
|
||||
import 'src/en/nineanimetv/source.dart';
|
||||
import 'src/es/animeonlineninja/source.dart';
|
||||
import 'src/fr/animesama/source.dart';
|
||||
import 'src/fr/anizone/source.dart';
|
||||
import 'src/hi/yomovies/source.dart';
|
||||
import 'src/en/kisskh/source.dart';
|
||||
import 'src/en/uhdmovies/source.dart';
|
||||
@@ -50,5 +52,7 @@ List<Source> dartAnimesourceList = [
|
||||
animepaheSource,
|
||||
animetoast,
|
||||
animesvision,
|
||||
diziwatchSource
|
||||
diziwatchSource,
|
||||
aniZoneSource,
|
||||
animeonlineninjaSource
|
||||
];
|
||||
|
||||
309
dart/anime/src/es/animeonlineninja/animeonlineninja.dart
Normal file
309
dart/anime/src/es/animeonlineninja/animeonlineninja.dart
Normal file
@@ -0,0 +1,309 @@
|
||||
import 'package:mangayomi/bridge_lib.dart';
|
||||
import 'dart:convert';
|
||||
|
||||
class AnimeOnlineNinja extends MProvider {
|
||||
AnimeOnlineNinja({required this.source});
|
||||
|
||||
MSource source;
|
||||
|
||||
final Client client = Client(source);
|
||||
|
||||
@override
|
||||
bool get supportsLatest => false;
|
||||
|
||||
@override
|
||||
Future<MPages> getPopular(int page) async {
|
||||
final res =
|
||||
(await client.get(Uri.parse("${source.baseUrl}/tendencias"))).body;
|
||||
return parseAnimeList(res);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MPages> search(String query, int page, FilterList filterList) async {
|
||||
String pageStr = page == 1 ? "" : "page/$page/";
|
||||
final res = (await client.get(Uri.parse(
|
||||
"${source.baseUrl}/$pageStr?s=${query.replaceAll(" ", "+")}")))
|
||||
.body;
|
||||
return parseAnimeList(res,
|
||||
selector: "div.result-item div.image a",
|
||||
hasNextPage: parseHtml(res)
|
||||
.selectFirst(
|
||||
"div.pagination > *:last-child:not(span):not(.current)")
|
||||
?.text !=
|
||||
null);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MManga> getDetail(String url) async {
|
||||
final res = (await client.get(Uri.parse("${source.baseUrl}$url"))).body;
|
||||
MManga anime = MManga();
|
||||
final document = parseHtml(res);
|
||||
anime.description = document.selectFirst("div#info").text;
|
||||
anime.genre = document
|
||||
.selectFirst("div.sheader")
|
||||
.select("div.data > div.sgeneros > a")
|
||||
.map((e) => e.text)
|
||||
.toList();
|
||||
|
||||
List<MChapter>? episodesList = [];
|
||||
final seasonElements = document.select("div#seasons > div");
|
||||
if (seasonElements.isEmpty) {
|
||||
MChapter episode = MChapter();
|
||||
episode.name = "Película";
|
||||
episode.url = getUrlWithoutDomain(url);
|
||||
episodesList.add(episode);
|
||||
} else {
|
||||
for (var seasonElement in seasonElements) {
|
||||
final seasonName = seasonElement.selectFirst("span.se-t").text;
|
||||
for (var epElement in seasonElement.select("ul.episodios > li")) {
|
||||
final href = epElement.selectFirst("a[href]");
|
||||
final epNum = epElement.selectFirst('div.numerando')?.text ?? "0 - 0";
|
||||
MChapter episode = MChapter();
|
||||
episode.name =
|
||||
"Season $seasonName x ${substringAfter(epNum, '- ')} ${href.text}";
|
||||
episode.url = getUrlWithoutDomain(href!.getHref);
|
||||
episodesList.add(episode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
anime.chapters = episodesList.reversed.toList();
|
||||
return anime;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<MVideo>> getVideoList(String url) async {
|
||||
final res = (await client.get(Uri.parse("${source.baseUrl}$url"))).body;
|
||||
final document = parseHtml(res);
|
||||
final players = document.select("ul#playeroptionsul li");
|
||||
List<MVideo> videos = [];
|
||||
for (var player in players) {
|
||||
final name = player.selectFirst("span.title").text;
|
||||
final type = player.attr("data-type");
|
||||
final id = player.attr("data-post");
|
||||
final num = player.attr("data-nume");
|
||||
final resUrl = (await client.get(Uri.parse(
|
||||
"${source.baseUrl}/wp-json/dooplayer/v1/post/$id?type=$type&source=$num")))
|
||||
.body;
|
||||
final url =
|
||||
substringBefore(substringAfter(resUrl, "\"embed_url\":\""), "\",")
|
||||
.replaceAll("\\", "");
|
||||
videos.addAll(await extractVideos(url, name));
|
||||
}
|
||||
return sortVideos(videos, source.id);
|
||||
}
|
||||
|
||||
Future<List<MVideo>> extractVideos(String url, String lang) async {
|
||||
List<MVideo> videos = [];
|
||||
List<MVideo> a = [];
|
||||
if (url.contains("saidochesto.top") || lang == "MULTISERVER") {
|
||||
return await extractFromMulti(url);
|
||||
} else if (["filemoon", "moon", "filemooon"].any((a) => url.contains(a))) {
|
||||
a = await filemoonExtractor(url, "$lang Filemoon - ", "");
|
||||
} else if (["https://dood", "https://ds2play", "https://d0"]
|
||||
.any((a) => url.contains(a))) {
|
||||
a = await doodExtractor(url, "$lang DoodStream");
|
||||
} else if (["streamtape", "stp", "stape"].any((a) => url.contains(a))) {
|
||||
a = await streamTapeExtractor(url, "$lang StreamTape");
|
||||
} else if (url.contains("uqload")) {
|
||||
a = await uqloadExtractor(url, lang);
|
||||
} else if (url.contains("wolfstream")) {
|
||||
final resUrl = (await client.get(Uri.parse(url))).body;
|
||||
final jsData =
|
||||
parseHtml(resUrl).selectFirst("script:contains(sources)").text;
|
||||
final videoUrl =
|
||||
substringBefore(substringAfter(jsData, "{file:\""), "\"");
|
||||
|
||||
MVideo video = MVideo();
|
||||
video
|
||||
..url = videoUrl
|
||||
..originalUrl = videoUrl
|
||||
..quality = "$lang WolfStream";
|
||||
|
||||
a = [video];
|
||||
} else if (["wishembed", "streamwish", "strwish", "wish"]
|
||||
.any((a) => url.contains(a))) {
|
||||
a = await streamWishExtractor(url, "$lang StreamWish");
|
||||
} else if (url.contains("mp4upload")) {
|
||||
a = await mp4UploadExtractor(url, null, "$lang", "");
|
||||
} else if (["vidhide", "filelions.top", "vid."]
|
||||
.any((a) => url.contains(a))) {
|
||||
a = await streamHideExtractor(url, lang);
|
||||
}
|
||||
videos.addAll(a);
|
||||
|
||||
return videos;
|
||||
}
|
||||
|
||||
Future<List<MVideo>> streamHideExtractor(String url, String prefix) async {
|
||||
final res = (await client.get(Uri.parse(url))).body;
|
||||
final masterUrl = substringBefore(
|
||||
substringAfter(
|
||||
substringAfter(
|
||||
substringAfter(unpackJs(res), "sources:"), "file:\""),
|
||||
"src:\""),
|
||||
'"');
|
||||
final masterPlaylistRes = (await client.get(Uri.parse(masterUrl))).body;
|
||||
List<MVideo> videos = [];
|
||||
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";
|
||||
}
|
||||
|
||||
MVideo video = MVideo();
|
||||
video
|
||||
..url = videoUrl
|
||||
..originalUrl = videoUrl
|
||||
..quality = "$prefix StreamHideVid - $quality";
|
||||
videos.add(video);
|
||||
}
|
||||
return videos;
|
||||
}
|
||||
|
||||
Future<List<MVideo>> uqloadExtractor(String url, String lang) async {
|
||||
final res = (await client.get(Uri.parse(url))).body;
|
||||
final js = xpath(res, '//script[contains(text(), "sources:")]/text()');
|
||||
if (js.isEmpty) {
|
||||
return [];
|
||||
}
|
||||
|
||||
final videoUrl =
|
||||
substringBefore(substringAfter(js.first, "sources: [\""), '"');
|
||||
MVideo video = MVideo();
|
||||
video
|
||||
..url = videoUrl
|
||||
..originalUrl = videoUrl
|
||||
..quality = "$lang Uqload"
|
||||
..headers = {"Referer": "${Uri.parse(url).origin}/"};
|
||||
return [video];
|
||||
}
|
||||
|
||||
Future<List<MVideo>> extractFromMulti(String url) async {
|
||||
final res = (await client.get(Uri.parse(url))).body;
|
||||
final document = parseHtml(res);
|
||||
|
||||
final prefLang = getPreferenceValue(source.id, "preferred_lang");
|
||||
String langSelector = "";
|
||||
if (prefLang.isEmpty) {
|
||||
langSelector = "div";
|
||||
} else {
|
||||
langSelector = "div.OD_$prefLang";
|
||||
}
|
||||
List<MVideo> videos = [];
|
||||
for (var element in document.select("div.ODDIV $langSelector > li")) {
|
||||
final hosterUrl =
|
||||
substringBefore(substringAfter(element.attr("onclick"), "('"), "')");
|
||||
String lang = "";
|
||||
if (langSelector == "div") {
|
||||
lang = substringBefore(
|
||||
substringAfter(element.parent?.attr("class"), "OD_", ""), " ");
|
||||
} else {
|
||||
lang = prefLang;
|
||||
}
|
||||
videos.addAll(await extractVideos(hosterUrl, lang));
|
||||
}
|
||||
|
||||
return videos;
|
||||
}
|
||||
|
||||
MPages parseAnimeList(String res,
|
||||
{String selector = "article.w_item_a > a", bool hasNextPage = false}) {
|
||||
final elements = parseHtml(res).select(selector);
|
||||
List<MManga> animeList = [];
|
||||
for (var element in elements) {
|
||||
final url = getUrlWithoutDomain(element.getHref);
|
||||
if (!url.startsWith("/episodio/")) {
|
||||
MManga anime = MManga();
|
||||
final img = element.selectFirst("img");
|
||||
anime.name = img.attr("alt");
|
||||
anime.imageUrl = img?.attr("data-src") ??
|
||||
img?.attr("data-lazy-src") ??
|
||||
img?.attr("srcset") ??
|
||||
img?.getSrc;
|
||||
anime.link = url;
|
||||
animeList.add(anime);
|
||||
}
|
||||
}
|
||||
return MPages(animeList, hasNextPage);
|
||||
}
|
||||
|
||||
@override
|
||||
List<dynamic> getSourcePreferences() {
|
||||
return [
|
||||
ListPreference(
|
||||
key: "preferred_lang",
|
||||
title: "Preferred language",
|
||||
summary: "",
|
||||
valueIndex: 0,
|
||||
entries: ["SUB", "All", "ES", "LAT"],
|
||||
entryValues: ["SUB", "", "ES", "LAT"]),
|
||||
ListPreference(
|
||||
key: "preferred_server1",
|
||||
title: "Preferred server",
|
||||
summary: "",
|
||||
valueIndex: 0,
|
||||
entries: [
|
||||
"Filemoon",
|
||||
"DoodStream",
|
||||
"StreamTape",
|
||||
"Uqload",
|
||||
"WolfStream",
|
||||
"saidochesto.top",
|
||||
"VidHide",
|
||||
"StreamWish",
|
||||
"Mp4Upload"
|
||||
],
|
||||
entryValues: [
|
||||
"Filemoon",
|
||||
"DoodStream",
|
||||
"StreamTape",
|
||||
"Uqload",
|
||||
"WolfStream",
|
||||
"saidochesto.top",
|
||||
"VidHide",
|
||||
"StreamWish",
|
||||
"Mp4Upload"
|
||||
]),
|
||||
];
|
||||
}
|
||||
|
||||
List<MVideo> sortVideos(List<MVideo> videos, int sourceId) {
|
||||
String prefLang = getPreferenceValue(source.id, "preferred_lang");
|
||||
String server = getPreferenceValue(sourceId, "preferred_server1");
|
||||
videos.sort((MVideo a, MVideo b) {
|
||||
int qualityMatchA = 0;
|
||||
|
||||
if (a.quality.toLowerCase().contains(prefLang.toLowerCase()) &&
|
||||
a.quality.toLowerCase().contains(server.toLowerCase())) {
|
||||
qualityMatchA = 1;
|
||||
}
|
||||
int qualityMatchB = 0;
|
||||
if (b.quality.toLowerCase().contains(prefLang.toLowerCase()) &&
|
||||
b.quality.toLowerCase().contains(server.toLowerCase())) {
|
||||
qualityMatchB = 1;
|
||||
}
|
||||
if (qualityMatchA != qualityMatchB) {
|
||||
return qualityMatchB - qualityMatchA;
|
||||
}
|
||||
|
||||
final regex = RegExp(r'(\d+)p');
|
||||
final matchA = regex.firstMatch(a.quality);
|
||||
final matchB = regex.firstMatch(b.quality);
|
||||
final int qualityNumA = int.tryParse(matchA?.group(1) ?? '0') ?? 0;
|
||||
final int qualityNumB = int.tryParse(matchB?.group(1) ?? '0') ?? 0;
|
||||
return qualityNumB - qualityNumA;
|
||||
});
|
||||
return videos;
|
||||
}
|
||||
}
|
||||
|
||||
AnimeOnlineNinja main(MSource source) {
|
||||
return AnimeOnlineNinja(source: source);
|
||||
}
|
||||
BIN
dart/anime/src/es/animeonlineninja/icon.png
Normal file
BIN
dart/anime/src/es/animeonlineninja/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.9 KiB |
16
dart/anime/src/es/animeonlineninja/source.dart
Normal file
16
dart/anime/src/es/animeonlineninja/source.dart
Normal file
@@ -0,0 +1,16 @@
|
||||
import '../../../../../model/source.dart';
|
||||
|
||||
Source get animeonlineninjaSource => _animeonlineninjaSource;
|
||||
const _animeonlineninjaVersion = "0.0.2";
|
||||
const _animeonlineninjaSourceCodeUrl =
|
||||
"https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/src/es/animeonlineninja/animeonlineninja.dart";
|
||||
Source _animeonlineninjaSource = Source(
|
||||
name: "AnimeOnline.Ninja",
|
||||
baseUrl: "https://ww3.animeonline.ninja",
|
||||
lang: "es",
|
||||
typeSource: "single",
|
||||
iconUrl:
|
||||
"https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/src/es/animeonlineninja/icon.png",
|
||||
sourceCodeUrl: _animeonlineninjaSourceCodeUrl,
|
||||
version: _animeonlineninjaVersion,
|
||||
isManga: false);
|
||||
490
dart/anime/src/fr/anizone/anizone.dart
Normal file
490
dart/anime/src/fr/anizone/anizone.dart
Normal file
@@ -0,0 +1,490 @@
|
||||
import 'package:mangayomi/bridge_lib.dart';
|
||||
import 'dart:convert';
|
||||
|
||||
class AniZone extends MProvider {
|
||||
AniZone({required this.source});
|
||||
|
||||
final MSource source;
|
||||
final Client client = Client(source);
|
||||
|
||||
// Constants for the xpath
|
||||
static const String urlXpath =
|
||||
'//*[contains(@class,"flw-item item-qtip")]/div[@class="film-poster"]/a/@href';
|
||||
static const String nameXpath =
|
||||
'//*[contains(@class,"flw-item item-qtip")]/div[@class="film-detail"]/h3/text()';
|
||||
static const String imageXpath =
|
||||
'//*[contains(@class,"flw-item item-qtip")]/div[@class="film-poster"]/img/@data-src';
|
||||
|
||||
// Methods for fetching the manga list (popular, latest & search)
|
||||
Future<MPages> _getMangaList(String url) async {
|
||||
final doc = (await client.get(Uri.parse(url))).body;
|
||||
List<MManga> animeList = [];
|
||||
|
||||
final urls = xpath(doc, urlXpath);
|
||||
final names = xpath(doc, nameXpath);
|
||||
final images = xpath(doc, imageXpath);
|
||||
|
||||
if (urls.isEmpty || names.isEmpty || images.isEmpty) {
|
||||
return MPages([], false);
|
||||
}
|
||||
|
||||
for (var i = 0; i < names.length; i++) {
|
||||
MManga anime = MManga();
|
||||
anime.name = names[i];
|
||||
anime.imageUrl = images[i];
|
||||
anime.link = urls[i];
|
||||
animeList.add(anime);
|
||||
}
|
||||
|
||||
return MPages(animeList, urls.isNotEmpty);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MPages> getPopular(int page) async {
|
||||
return _getMangaList("${source.baseUrl}/most-popular/?page=$page");
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MPages> getLatestUpdates(int page) async {
|
||||
return _getMangaList("${source.baseUrl}/recently-added/?page=$page");
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MPages> search(String query, int page, FilterList filterList) async {
|
||||
String baseUrl = "${source.baseUrl}/filter?keyword=$query";
|
||||
|
||||
Map<String, List<String>> filterMap = {
|
||||
"type": [],
|
||||
"status": [],
|
||||
"season": [],
|
||||
"lang": [],
|
||||
"genre": []
|
||||
};
|
||||
|
||||
// Regroupement des filtres avec une logique générique
|
||||
final filterHandlers = {
|
||||
"TypeFilter": "type",
|
||||
"LanguageFilter": "lang",
|
||||
"SaisonFilter": "season",
|
||||
"StatusFilter": "status",
|
||||
"GenreFilter": "genre"
|
||||
};
|
||||
|
||||
for (var filter in filterList.filters) {
|
||||
if (filterHandlers.containsKey(filter.type)) {
|
||||
var key = filterHandlers[filter.type]!;
|
||||
for (var stateItem in filter.state as List) {
|
||||
if (stateItem.state == true) {
|
||||
filterMap[key]?.add(stateItem.value as String);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//add filters to the url dynamically
|
||||
for (var entry in filterMap.entries) {
|
||||
List<String> values = entry.value;
|
||||
if (values.isNotEmpty) {
|
||||
baseUrl += '&${entry.key}=${values.join("%2C")}';
|
||||
}
|
||||
}
|
||||
|
||||
return _getMangaList("$baseUrl&page=$page");
|
||||
}
|
||||
|
||||
Future<MManga> getDetail(String url) async {
|
||||
MManga anime = MManga();
|
||||
try {
|
||||
final doc = (await client.get(Uri.parse(url))).body;
|
||||
final description = xpath(doc, '//p[contains(@class,"short")]/text()');
|
||||
anime.description = description.isNotEmpty ? description.first : "";
|
||||
|
||||
final statusList = xpath(doc,
|
||||
'//div[contains(@class,"col2")]//div[contains(@class,"item")]//div[contains(@class,"item-content")]/text()');
|
||||
if (statusList.isNotEmpty) {
|
||||
if (statusList[0] == "Terminer") {
|
||||
anime.status = MStatus.completed;
|
||||
} else if (statusList[0] == "En cours") {
|
||||
anime.status = MStatus.ongoing;
|
||||
} else {
|
||||
anime.status = MStatus.unknown;
|
||||
}
|
||||
} else {
|
||||
anime.status = MStatus.unknown;
|
||||
}
|
||||
|
||||
anime.genre = xpath(doc,
|
||||
'//div[contains(@class,"item")]//div[contains(@class,"item-content")]//a[contains(@href,"genre")]/text()');
|
||||
|
||||
final regex = RegExp(r'(\d+)$');
|
||||
final match = regex.firstMatch(url);
|
||||
|
||||
if (match == null) {
|
||||
throw Exception('Numéro de l\'épisode non trouvé dans l\'URL.');
|
||||
}
|
||||
|
||||
final res = (await client.get(Uri.parse(
|
||||
"${source.baseUrl}/ajax/episode/list/${match.group(1)}")))
|
||||
.body;
|
||||
|
||||
List<MChapter> episodesList = [];
|
||||
|
||||
final episodeElements =
|
||||
parseHtml(json.decode(res)["html"]).select(".ep-item");
|
||||
|
||||
// Associer chaque titre à son URL et récupérer les vidéos
|
||||
for (var element in episodeElements) {
|
||||
MChapter episode = MChapter();
|
||||
episode.name = element.attr("title");
|
||||
|
||||
String id = substringAfterLast(element.attr("href"), "=");
|
||||
episode.url = "${source.baseUrl}/ajax/episode/servers?episodeId=$id";
|
||||
episodesList.add(episode);
|
||||
}
|
||||
|
||||
anime.chapters = episodesList.reversed.toList();
|
||||
|
||||
return anime;
|
||||
} catch (e) {
|
||||
throw Exception('Erreur lors de la récupération des détails: $e');
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<MVideo>> getVideoList(String url) async {
|
||||
final videoRes = (await client
|
||||
.get(Uri.parse(url), headers: {"Referer": "${source.baseUrl}/"}))
|
||||
.body;
|
||||
|
||||
final lang = xpath(videoRes.replaceAll(r'\', ''),
|
||||
'//div[contains(@class,"item server-item")]/@data-type');
|
||||
final links = xpath(videoRes.replaceAll(r'\', ''),
|
||||
'//div[contains(@class,"item server-item")]/@data-id');
|
||||
final playersNames = xpath(videoRes.replaceAll(r'\', ''),
|
||||
'//div[contains(@class,"item server-item")]/text()');
|
||||
List<Map<String, String>> players = [];
|
||||
for (int j = 0; j < links.length; j++) {
|
||||
// schema of players https://v1.animesz.xyz/ajax/episode/servers?episodeId=(id_episode)
|
||||
// schema or url https://v1.animesz.xyz/ajax/episode/sources?id=(player_id)&epid=(id_episode)
|
||||
if (playersNames.isNotEmpty && playersNames[j] == "sibnet") {
|
||||
final playerUrl =
|
||||
"https://video.sibnet.ru/shell.php?videoid=${links[j]}";
|
||||
players.add({"lang": lang[j], "player": playerUrl});
|
||||
} else if (playersNames.isNotEmpty && playersNames[j] == "sendvid") {
|
||||
final playerUrl = "https://sendvid.com/embed/${links[j]}";
|
||||
players.add({"lang": lang[j], "player": playerUrl});
|
||||
} else if (playersNames.isNotEmpty && playersNames[j] == "VidCDN") {
|
||||
final playerUrl =
|
||||
"https://r.vidcdn.xyz/v1/api/get_sources/${links[j].replaceFirst(RegExp(r'vidcdn$'), '')}";
|
||||
players.add({"lang": lang[j], "player": playerUrl});
|
||||
} else if (playersNames.isNotEmpty && playersNames[j] == "Voe") {
|
||||
final playerUrl = "https://voe.sx/e/${links[j]}";
|
||||
players.add({"lang": lang[j], "player": playerUrl});
|
||||
} else if (playersNames.isNotEmpty && playersNames[j] == "Fmoon") {
|
||||
final playerUrl =
|
||||
"https://filemoon.sx/e/${links[j]}&data-realid=${links[j]}&epid=${substringAfter(url, "episodeId=")}";
|
||||
players.add({"lang": lang[j], "player": playerUrl});
|
||||
}
|
||||
}
|
||||
|
||||
List<MVideo> videos = [];
|
||||
for (var player in players) {
|
||||
String lang = (player["lang"] as String).toUpperCase();
|
||||
String playerUrl = player["player"];
|
||||
List<MVideo> a = [];
|
||||
if (playerUrl.contains("sendvid")) {
|
||||
a = await sendVidExtractorr(playerUrl, "$lang ");
|
||||
} else if (playerUrl.contains("sibnet.ru")) {
|
||||
a = await sibnetExtractor(playerUrl, lang);
|
||||
} else if (playerUrl.contains("voe.sx")) {
|
||||
a = await voeExtractor(playerUrl, "$lang ");
|
||||
} else if (playerUrl.contains("vidcdn")) {
|
||||
a = await vidcdnExtractor(playerUrl, lang);
|
||||
} else if (playerUrl.contains("filemoon")) {
|
||||
a = await filemoonExtractor(playerUrl, "$lang Filemoon - ", "");
|
||||
} else if (playerUrl.contains("vidhide")) {
|
||||
a = await streamHideExtractor(playerUrl, lang);
|
||||
}
|
||||
videos.addAll(a);
|
||||
}
|
||||
|
||||
return sortVideos(videos, source.id);
|
||||
}
|
||||
|
||||
Future<List<MVideo>> streamHideExtractor(String url, String prefix) async {
|
||||
final res = (await client.get(Uri.parse(url))).body;
|
||||
final masterUrl = substringBefore(
|
||||
substringAfter(
|
||||
substringAfter(
|
||||
substringAfter(unpackJs(res), "sources:"), "file:\""),
|
||||
"src:\""),
|
||||
'"');
|
||||
final masterPlaylistRes = (await client.get(Uri.parse(masterUrl))).body;
|
||||
List<MVideo> videos = [];
|
||||
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";
|
||||
}
|
||||
|
||||
MVideo video = MVideo();
|
||||
video
|
||||
..url = videoUrl
|
||||
..originalUrl = videoUrl
|
||||
..quality = "$prefix StreamHideVid - $quality";
|
||||
videos.add(video);
|
||||
}
|
||||
return videos;
|
||||
}
|
||||
|
||||
@override
|
||||
List<dynamic> getFilterList() {
|
||||
return [
|
||||
GroupFilter("TypeFilter", "Type", [
|
||||
CheckBoxFilter("Film", "1"),
|
||||
CheckBoxFilter("Anime", "2"),
|
||||
CheckBoxFilter("OVA", "3"),
|
||||
CheckBoxFilter("ONA", "4"),
|
||||
CheckBoxFilter("Special", "5"),
|
||||
CheckBoxFilter("Music", "6"),
|
||||
]),
|
||||
GroupFilter("LanguageFilter", "Langue", [
|
||||
CheckBoxFilter("VF", "3"),
|
||||
CheckBoxFilter("VOSTFR", "4"),
|
||||
CheckBoxFilter("Multicc", "2"),
|
||||
CheckBoxFilter("EN", "1"),
|
||||
]),
|
||||
GroupFilter("SaisonFilter", "Saison", [
|
||||
CheckBoxFilter("Printemps", "1"),
|
||||
CheckBoxFilter("Été", "2"),
|
||||
CheckBoxFilter("Automne", "3"),
|
||||
CheckBoxFilter("Hiver", "4"),
|
||||
]),
|
||||
GroupFilter("StatusFilter", "Statut", [
|
||||
CheckBoxFilter("Terminés", "1"),
|
||||
CheckBoxFilter("En cours", "2"),
|
||||
CheckBoxFilter("Pas encore diffusés", "3"),
|
||||
]),
|
||||
GroupFilter("GenreFilter", "Genre", [
|
||||
CheckBoxFilter("Action", "1"),
|
||||
CheckBoxFilter("Aventure", "2"),
|
||||
CheckBoxFilter("Voitures", "3"),
|
||||
CheckBoxFilter("Comédie", "4"),
|
||||
CheckBoxFilter("Démence", "5"),
|
||||
CheckBoxFilter("Démons", "6"),
|
||||
CheckBoxFilter("Drame", "8"),
|
||||
CheckBoxFilter("Ecchi", "9"),
|
||||
CheckBoxFilter("Fantastique", "10"),
|
||||
CheckBoxFilter("Jeu", "11"),
|
||||
CheckBoxFilter("Harem", "35"),
|
||||
CheckBoxFilter("Historique", "13"),
|
||||
CheckBoxFilter("Horreur", "14"),
|
||||
CheckBoxFilter("Isekai", "44"),
|
||||
CheckBoxFilter("Josei", "43"),
|
||||
CheckBoxFilter("Enfants", "25"),
|
||||
CheckBoxFilter("Magie", "16"),
|
||||
CheckBoxFilter("Arts martiaux", "17"),
|
||||
CheckBoxFilter("Mecha", "18"),
|
||||
CheckBoxFilter("Militaire", "38"),
|
||||
CheckBoxFilter("Musique", "19"),
|
||||
CheckBoxFilter("Mystère", "7"),
|
||||
CheckBoxFilter("Parodie", "20"),
|
||||
CheckBoxFilter("Police", "39"),
|
||||
CheckBoxFilter("Psychologique", "40"),
|
||||
CheckBoxFilter("Romance", "22"),
|
||||
CheckBoxFilter("Samouraï", "21"),
|
||||
CheckBoxFilter("École", "23"),
|
||||
CheckBoxFilter("Science-Fiction", "24"),
|
||||
CheckBoxFilter("Seinen", "42"),
|
||||
CheckBoxFilter("Shoujo Ai", "26"),
|
||||
CheckBoxFilter("Shoujo", "25"),
|
||||
CheckBoxFilter("Shounen Ai", "28"),
|
||||
CheckBoxFilter("Tranche de vie", "36"),
|
||||
CheckBoxFilter("Shounen", "27"),
|
||||
CheckBoxFilter("Espace", "29"),
|
||||
CheckBoxFilter("Sports", "30"),
|
||||
CheckBoxFilter("Super Pouvoir", "31"),
|
||||
CheckBoxFilter("Surnaturel", "37"),
|
||||
CheckBoxFilter("Vampire", "32"),
|
||||
CheckBoxFilter("Yaoi", "33"),
|
||||
CheckBoxFilter("Yuri", "34"),
|
||||
])
|
||||
];
|
||||
}
|
||||
|
||||
@override
|
||||
List<dynamic> getSourcePreferences() {
|
||||
return [
|
||||
ListPreference(
|
||||
key: "preferred_quality",
|
||||
title: "Qualité préférée",
|
||||
summary: "",
|
||||
valueIndex: 0,
|
||||
entries: ["1080p", "720p", "480p", "360p"],
|
||||
entryValues: ["1080", "720", "480", "360"]),
|
||||
ListPreference(
|
||||
key: "voices_preference",
|
||||
title: "Préférence des voix",
|
||||
summary: "",
|
||||
valueIndex: 0,
|
||||
entries: ["Préférer VOSTFR", "Préférer VF"],
|
||||
entryValues: ["vostfr", "vf"]),
|
||||
];
|
||||
}
|
||||
|
||||
List<MVideo> sortVideos(List<MVideo> videos, int sourceId) {
|
||||
String quality = getPreferenceValue(sourceId, "preferred_quality");
|
||||
String voice = getPreferenceValue(sourceId, "voices_preference");
|
||||
|
||||
videos.sort((MVideo a, MVideo b) {
|
||||
int qualityMatchA = 0;
|
||||
if (a.quality.contains(quality) &&
|
||||
a.quality.toLowerCase().contains(voice)) {
|
||||
qualityMatchA = 1;
|
||||
}
|
||||
int qualityMatchB = 0;
|
||||
if (b.quality.contains(quality) &&
|
||||
b.quality.toLowerCase().contains(voice)) {
|
||||
qualityMatchB = 1;
|
||||
}
|
||||
if (qualityMatchA != qualityMatchB) {
|
||||
return qualityMatchB - qualityMatchA;
|
||||
}
|
||||
|
||||
final regex = RegExp(r'(\d+)p');
|
||||
final matchA = regex.firstMatch(a.quality);
|
||||
final matchB = regex.firstMatch(b.quality);
|
||||
final int qualityNumA = int.tryParse(matchA?.group(1) ?? '0') ?? 0;
|
||||
final int qualityNumB = int.tryParse(matchB?.group(1) ?? '0') ?? 0;
|
||||
return qualityNumB - qualityNumA;
|
||||
});
|
||||
return videos;
|
||||
}
|
||||
|
||||
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");
|
||||
print(masterUrl);
|
||||
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;
|
||||
}
|
||||
|
||||
Future<List<MVideo>> vidcdnExtractor(String url, String prefix) async {
|
||||
final res = await client.get(Uri.parse(url));
|
||||
if (res.statusCode != 200) {
|
||||
print("Erreur lors de la récupération de la page : ${res.statusCode}");
|
||||
return [];
|
||||
}
|
||||
final jsonResponse = jsonDecode(res.body);
|
||||
|
||||
String masterUrl = jsonResponse['sources'][0]['file'] ?? '';
|
||||
final quality = jsonResponse['quality'] ?? '';
|
||||
|
||||
List<MVideo> videos = [];
|
||||
|
||||
final masterPlaylistRes = await client.get(Uri.parse(masterUrl));
|
||||
if (masterPlaylistRes.statusCode != 200) {
|
||||
print(
|
||||
"Error lors de la récupération de la playlist M3U8 : ${masterPlaylistRes.statusCode}");
|
||||
return [];
|
||||
}
|
||||
|
||||
final masterPlaylistBody = masterPlaylistRes.body;
|
||||
|
||||
final playlistLines = masterPlaylistBody.split("\n");
|
||||
|
||||
for (int i = 0; i < playlistLines.length; i++) {
|
||||
final line = playlistLines[i];
|
||||
if (line.startsWith("#EXT-X-STREAM-INF")) {
|
||||
final resolutionLine = line.split("RESOLUTION=").last;
|
||||
final resolution = resolutionLine.split(",").first;
|
||||
final width = int.parse(resolution.split("x").first);
|
||||
final height = int.parse(resolution.split("x").last);
|
||||
|
||||
String videoQuality;
|
||||
if (height >= 1080) {
|
||||
videoQuality = "1080p";
|
||||
} else if (height >= 720) {
|
||||
videoQuality = "720p";
|
||||
} else if (height >= 480) {
|
||||
videoQuality = "480p";
|
||||
} else if (height >= 360) {
|
||||
videoQuality = "360p";
|
||||
} else {
|
||||
videoQuality = "${height}p";
|
||||
}
|
||||
|
||||
String videoUrl = playlistLines[i + 1].trim();
|
||||
|
||||
if (!videoUrl.startsWith("http")) {
|
||||
videoUrl =
|
||||
"${masterUrl.substring(0, masterUrl.lastIndexOf('/'))}/$videoUrl";
|
||||
}
|
||||
|
||||
var video = MVideo();
|
||||
video
|
||||
..url = masterUrl
|
||||
..originalUrl = masterUrl
|
||||
..quality = "$prefix VidCDN:$videoQuality";
|
||||
videos.add(video);
|
||||
}
|
||||
}
|
||||
return videos;
|
||||
}
|
||||
}
|
||||
|
||||
AniZone main(MSource source) {
|
||||
return AniZone(source: source);
|
||||
}
|
||||
BIN
dart/anime/src/fr/anizone/icon.png
Normal file
BIN
dart/anime/src/fr/anizone/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
16
dart/anime/src/fr/anizone/source.dart
Normal file
16
dart/anime/src/fr/anizone/source.dart
Normal file
@@ -0,0 +1,16 @@
|
||||
import '../../../../../model/source.dart';
|
||||
|
||||
Source get aniZoneSource => _aniZoneSource;
|
||||
const _aniZoneVersion = "0.0.2";
|
||||
const _aniZoneSourceCodeUrl =
|
||||
"https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/src/fr/anizone/anizone.dart";
|
||||
Source _aniZoneSource = Source(
|
||||
name: "AniZone",
|
||||
baseUrl: "https://v1.animesz.xyz",
|
||||
lang: "fr",
|
||||
typeSource: "single",
|
||||
iconUrl:
|
||||
"https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/src/fr/anizone/icon.png",
|
||||
sourceCodeUrl: _aniZoneSourceCodeUrl,
|
||||
version: _aniZoneVersion,
|
||||
isManga: false);
|
||||
@@ -1,12 +1,12 @@
|
||||
import '../../../../../model/source.dart';
|
||||
|
||||
Source get animesaturn => _animesaturn;
|
||||
const _animesaturnVersion = "0.0.35";
|
||||
const _animesaturnVersion = "0.0.4";
|
||||
const _animesaturnCodeUrl =
|
||||
"https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/src/it/animesaturn/animesaturn.dart";
|
||||
Source _animesaturn = Source(
|
||||
name: "AnimeSaturn",
|
||||
baseUrl: "https://www.animesaturn.tv",
|
||||
baseUrl: "https://www.animesaturn.cx",
|
||||
lang: "it",
|
||||
typeSource: "single",
|
||||
iconUrl:
|
||||
|
||||
Reference in New Issue
Block a user