mirror of
https://github.com/kodjodevf/mangayomi-extensions.git
synced 2026-02-14 19:01:15 +00:00
WIP
This commit is contained in:
@@ -1,101 +1,88 @@
|
||||
import 'package:mangayomi/bridge_lib.dart';
|
||||
import 'dart:convert';
|
||||
|
||||
class ZoroTheme extends MSourceProvider {
|
||||
class ZoroTheme extends MProvider {
|
||||
ZoroTheme();
|
||||
|
||||
@override
|
||||
Future<MPages> getPopular(MSource sourceInfo, int page) async {
|
||||
final data = {"url": "${sourceInfo.baseUrl}/most-popular?page=$page"};
|
||||
final res = await MBridge.http('GET', json.encode(data));
|
||||
Future<MPages> getPopular(MSource source, int page) async {
|
||||
final data = {"url": "${source.baseUrl}/most-popular?page=$page"};
|
||||
final res = await http('GET', json.encode(data));
|
||||
|
||||
return animeElementM(res);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MPages> getLatestUpdates(MSource sourceInfo, int page) async {
|
||||
final data = {"url": "${sourceInfo.baseUrl}/recently-updated?page=$page"};
|
||||
final res = await MBridge.http('GET', json.encode(data));
|
||||
Future<MPages> getLatestUpdates(MSource source, int page) async {
|
||||
final data = {"url": "${source.baseUrl}/recently-updated?page=$page"};
|
||||
final res = await http('GET', json.encode(data));
|
||||
|
||||
return animeElementM(res);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MPages> search(MSource sourceInfo, String query, int page) async {
|
||||
Future<MPages> search(MSource source, String query, int page) async {
|
||||
final data = {
|
||||
"url": "${sourceInfo.baseUrl}/search?keyword=$query&page=$page"
|
||||
"url": "${source.baseUrl}/search?keyword=$query&page=$page"
|
||||
};
|
||||
final res = await MBridge.http('GET', json.encode(data));
|
||||
final res = await http('GET', json.encode(data));
|
||||
|
||||
return animeElementM(res);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MManga> getDetail(MSource sourceInfo, String url) async {
|
||||
Future<MManga> getDetail(MSource source, String url) async {
|
||||
final statusList = [
|
||||
{
|
||||
"Currently Airing": 0,
|
||||
"Finished Airing": 1,
|
||||
}
|
||||
];
|
||||
final data = {"url": "${sourceInfo.baseUrl}$url"};
|
||||
final res = await MBridge.http('GET', json.encode(data));
|
||||
final data = {"url": "${source.baseUrl}$url"};
|
||||
final res = await http('GET', json.encode(data));
|
||||
MManga anime = MManga();
|
||||
final status = MBridge.xpath(res,
|
||||
final status = xpath(res,
|
||||
'//*[@class="anisc-info"]/div[contains(text(),"Status:")]/span[2]/text()')
|
||||
.first;
|
||||
anime.status = MBridge.parseStatus(status, statusList);
|
||||
anime.author = MBridge.xpath(res,
|
||||
|
||||
anime.status = parseStatus(status, statusList);
|
||||
anime.author = xpath(res,
|
||||
'//*[@class="anisc-info"]/div[contains(text(),"Studios:")]/span/text()')
|
||||
.first
|
||||
.replaceAll("Studios:", "");
|
||||
final aired = MBridge.xpath(res,
|
||||
'//*[@class="anisc-info"]/div[contains(text(),"Aired:")]/span/text()')
|
||||
.first;
|
||||
final japanese = MBridge.xpath(res,
|
||||
'//*[@class="anisc-info"]/div[contains(text(),"Japanese:")]/span/text()')
|
||||
.first;
|
||||
final synonyms = MBridge.xpath(res,
|
||||
'//*[@class="anisc-info"]/div[contains(text(),"Synonyms:")]/span/text()')
|
||||
.first;
|
||||
final premiered = MBridge.xpath(res,
|
||||
'//*[@class="anisc-info"]/div[contains(text(),"Premiered:")]/span/text()')
|
||||
.first;
|
||||
final overview = MBridge.xpath(res,
|
||||
anime.description = xpath(res,
|
||||
'//*[@class="anisc-info"]/div[contains(text(),"Overview:")]/text()')
|
||||
.first
|
||||
.replaceAll("Overview:", "");
|
||||
String description =
|
||||
"$overview\n\n$japanese\n$synonyms\n$aired\n$premiered";
|
||||
anime.description = description;
|
||||
final genre = MBridge.xpath(res,
|
||||
final genre = xpath(res,
|
||||
'//*[@class="anisc-info"]/div[contains(text(),"Genres:")]/a/text()');
|
||||
|
||||
anime.genre = genre;
|
||||
final id = MBridge.substringAfterLast(anime.link, '-');
|
||||
final id = substringAfterLast(url, '-');
|
||||
|
||||
final urlEp =
|
||||
"${anime.baseUrl}/ajax${ajaxRoute('${anime.baseUrl}')}/episode/list/$id";
|
||||
"${source.baseUrl}/ajax${ajaxRoute('${source.baseUrl}')}/episode/list/$id";
|
||||
|
||||
final dataEp = {
|
||||
"url": urlEp,
|
||||
"headers": {"referer": url}
|
||||
};
|
||||
final resEp = await MBridge.http('GET', json.encode(dataEp));
|
||||
final resEp = await http('GET', json.encode(dataEp));
|
||||
|
||||
final html = json.decode(resEp)["html"];
|
||||
|
||||
final epUrls = MBridge.querySelectorAll(html,
|
||||
final epUrls = querySelectorAll(html,
|
||||
selector: "a.ep-item",
|
||||
typeElement: 3,
|
||||
attributes: "href",
|
||||
typeRegExp: 0);
|
||||
final numbers = MBridge.querySelectorAll(html,
|
||||
final numbers = querySelectorAll(html,
|
||||
selector: "a.ep-item",
|
||||
typeElement: 3,
|
||||
attributes: "data-number",
|
||||
typeRegExp: 0);
|
||||
|
||||
final titles = MBridge.querySelectorAll(html,
|
||||
final titles = querySelectorAll(html,
|
||||
selector: "a.ep-item",
|
||||
typeElement: 3,
|
||||
attributes: "title",
|
||||
@@ -121,30 +108,30 @@ class ZoroTheme extends MSourceProvider {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<MVideo>> getVideoList(MSource sourceInfo, String url) async {
|
||||
final id = MBridge.substringAfterLast(url, '?ep=');
|
||||
Future<List<MVideo>> getVideoList(MSource source, String url) async {
|
||||
final id = substringAfterLast(url, '?ep=');
|
||||
|
||||
final datas = {
|
||||
"url":
|
||||
"${sourceInfo.baseUrl}/ajax${ajaxRoute('${sourceInfo.baseUrl}')}/episode/servers?episodeId=$id",
|
||||
"headers": {"referer": "${sourceInfo.baseUrl}/$url"}
|
||||
"${source.baseUrl}/ajax${ajaxRoute('${source.baseUrl}')}/episode/servers?episodeId=$id",
|
||||
"headers": {"referer": "${source.baseUrl}/$url"}
|
||||
};
|
||||
final res = await MBridge.http('GET', json.encode(datas));
|
||||
final res = await http('GET', json.encode(datas));
|
||||
final html = json.decode(res)["html"];
|
||||
|
||||
final names = MBridge.querySelectorAll(html,
|
||||
final names = querySelectorAll(html,
|
||||
selector: "div.server-item",
|
||||
typeElement: 0,
|
||||
attributes: "",
|
||||
typeRegExp: 0);
|
||||
|
||||
final ids = MBridge.querySelectorAll(html,
|
||||
final ids = querySelectorAll(html,
|
||||
selector: "div.server-item",
|
||||
typeElement: 3,
|
||||
attributes: "data-id",
|
||||
typeRegExp: 0);
|
||||
|
||||
final subDubs = MBridge.querySelectorAll(html,
|
||||
final subDubs = querySelectorAll(html,
|
||||
selector: "div.server-item",
|
||||
typeElement: 3,
|
||||
attributes: "data-type",
|
||||
@@ -158,21 +145,21 @@ class ZoroTheme extends MSourceProvider {
|
||||
final subDub = subDubs[i];
|
||||
final datasE = {
|
||||
"url":
|
||||
"${sourceInfo.baseUrl}/ajax${ajaxRoute('${sourceInfo.baseUrl}')}/episode/sources?id=$id",
|
||||
"headers": {"referer": "${sourceInfo.baseUrl}/$url"}
|
||||
"${source.baseUrl}/ajax${ajaxRoute('${source.baseUrl}')}/episode/sources?id=$id",
|
||||
"headers": {"referer": "${source.baseUrl}/$url"}
|
||||
};
|
||||
|
||||
final resE = await MBridge.http('GET', json.encode(datasE));
|
||||
String epUrl = MBridge.substringBefore(
|
||||
MBridge.substringAfter(resE, "\"link\":\""), "\"");
|
||||
final resE = await http('GET', json.encode(datasE));
|
||||
String epUrl = substringBefore(
|
||||
substringAfter(resE, "\"link\":\""), "\"");
|
||||
print(epUrl);
|
||||
List<MVideo> a = [];
|
||||
if (name.contains("Vidstreaming")) {
|
||||
a = await MBridge.rapidCloudExtractor(epUrl, "Vidstreaming - $subDub");
|
||||
a = await rapidCloudExtractor(epUrl, "Vidstreaming - $subDub");
|
||||
} else if (name.contains("Vidcloud")) {
|
||||
a = await MBridge.rapidCloudExtractor(epUrl, "Vidcloud - $subDub");
|
||||
a = await rapidCloudExtractor(epUrl, "Vidcloud - $subDub");
|
||||
} else if (name.contains("StreamTape")) {
|
||||
a = await MBridge.streamTapeExtractor(epUrl, "StreamTape - $subDub");
|
||||
a = await streamTapeExtractor(epUrl, "StreamTape - $subDub");
|
||||
}
|
||||
videos.addAll(a);
|
||||
}
|
||||
@@ -181,22 +168,21 @@ class ZoroTheme extends MSourceProvider {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<String>> getPageList(MSource sourceInfo, String url) async {
|
||||
Future<List<String>> getPageList(MSource source, String url) async {
|
||||
return [];
|
||||
}
|
||||
|
||||
MPages animeElementM(String res) {
|
||||
List<MManga> animeList = [];
|
||||
|
||||
final urls = MBridge.xpath(
|
||||
final urls = xpath(
|
||||
res, '//*[@class^="flw-item"]/div[@class="film-detail"]/h3/a/@href');
|
||||
|
||||
final names = MBridge.xpath(res,
|
||||
final names = xpath(res,
|
||||
'//*[@class^="flw-item"]/div[@class="film-detail"]/h3/a/@data-jname');
|
||||
|
||||
final images = MBridge.xpath(
|
||||
final images = xpath(
|
||||
res, '//*[@class^="flw-item"]/div[@class="film-poster"]/img/@data-src');
|
||||
|
||||
for (var i = 0; i < names.length; i++) {
|
||||
MManga anime = MManga();
|
||||
anime.name = names[i];
|
||||
@@ -204,7 +190,7 @@ class ZoroTheme extends MSourceProvider {
|
||||
anime.link = urls[i];
|
||||
animeList.add(anime);
|
||||
}
|
||||
final nextPage = MBridge.xpath(
|
||||
final nextPage = xpath(
|
||||
res, '//li[@class="page-item"]/a[@title="Next"]/@href', "");
|
||||
return MPages(animeList, !nextPage.isEmpty);
|
||||
}
|
||||
@@ -220,3 +206,4 @@ class ZoroTheme extends MSourceProvider {
|
||||
ZoroTheme main() {
|
||||
return ZoroTheme();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
import 'package:mangayomi/bridge_lib.dart';
|
||||
import 'dart:convert';
|
||||
|
||||
class OkAnime extends MSourceProvider {
|
||||
class OkAnime extends MProvider {
|
||||
OkAnime();
|
||||
|
||||
@override
|
||||
Future<MPages> getPopular(MSource sourceInfo, int page) async {
|
||||
final data = {"url": sourceInfo.baseUrl};
|
||||
final res = await MBridge.http('GET', json.encode(data));
|
||||
Future<MPages> getPopular(MSource source, int page) async {
|
||||
final data = {"url": source.baseUrl};
|
||||
final res = await http('GET', json.encode(data));
|
||||
|
||||
List<MManga> animeList = [];
|
||||
final urls = MBridge.xpath(res,
|
||||
final urls = xpath(res,
|
||||
'//div[@class="section" and contains(text(),"افضل انميات")]/div[@class="section-content"]/div/div/div[contains(@class,"anime-card")]/div[@class="anime-title")]/h4/a/@href');
|
||||
final names = MBridge.xpath(res,
|
||||
final names = xpath(res,
|
||||
'//div[@class="section" and contains(text(),"افضل انميات")]/div[@class="section-content"]/div/div/div[contains(@class,"anime-card")]/div[@class="anime-title")]/h4/a/text()');
|
||||
final images = MBridge.xpath(res,
|
||||
final images = xpath(res,
|
||||
'//div[@class="section" and contains(text(),"افضل انميات")]/div[@class="section-content"]/div/div/div[contains(@class,"anime-card")]/div[@class="anime-image")]/img/@src');
|
||||
|
||||
for (var i = 0; i < names.length; i++) {
|
||||
@@ -28,16 +28,16 @@ class OkAnime extends MSourceProvider {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MPages> getLatestUpdates(MSource sourceInfo, int page) async {
|
||||
final data = {"url": "${sourceInfo.baseUrl}/espisode-list?page=$page"};
|
||||
final res = await MBridge.http('GET', json.encode(data));
|
||||
Future<MPages> getLatestUpdates(MSource source, int page) async {
|
||||
final data = {"url": "${source.baseUrl}/espisode-list?page=$page"};
|
||||
final res = await http('GET', json.encode(data));
|
||||
|
||||
List<MManga> animeList = [];
|
||||
final urls = MBridge.xpath(res,
|
||||
final urls = xpath(res,
|
||||
'//*[contains(@class,"anime-card")]/div[@class="anime-title")]/h4/a/@href');
|
||||
final names = MBridge.xpath(res,
|
||||
final names = xpath(res,
|
||||
'//*[contains(@class,"anime-card")]/div[@class="anime-title")]/h4/a/text()');
|
||||
final images = MBridge.xpath(res,
|
||||
final images = xpath(res,
|
||||
'//*[contains(@class,"anime-card")]/div[@class="episode-image")]/img/@src');
|
||||
|
||||
for (var i = 0; i < names.length; i++) {
|
||||
@@ -48,25 +48,25 @@ class OkAnime extends MSourceProvider {
|
||||
animeList.add(anime);
|
||||
}
|
||||
final nextPage =
|
||||
MBridge.xpath(res, '//li[@class="page-item"]/a[@rel="next"]/@href');
|
||||
xpath(res, '//li[@class="page-item"]/a[@rel="next"]/@href');
|
||||
return MPages(animeList, nextPage.isNotEmpty);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MPages> search(MSource sourceInfo, String query, int page) async {
|
||||
String url = "${sourceInfo.baseUrl}/search/?s=$query";
|
||||
Future<MPages> search(MSource source, String query, int page) async {
|
||||
String url = "${source.baseUrl}/search/?s=$query";
|
||||
if (page > 1) {
|
||||
url += "&page=$page";
|
||||
}
|
||||
final data = {"url": url};
|
||||
final res = await MBridge.http('GET', json.encode(data));
|
||||
final res = await http('GET', json.encode(data));
|
||||
|
||||
List<MManga> animeList = [];
|
||||
final urls = MBridge.xpath(res,
|
||||
final urls = xpath(res,
|
||||
'//*[contains(@class,"anime-card")]/div[@class="anime-title")]/h4/a/@href');
|
||||
final names = MBridge.xpath(res,
|
||||
final names = xpath(res,
|
||||
'//*[contains(@class,"anime-card")]/div[@class="anime-title")]/h4/a/text()');
|
||||
final images = MBridge.xpath(res,
|
||||
final images = xpath(res,
|
||||
'//*[contains(@class,"anime-card")]/div[@class="anime-image")]/img/@src');
|
||||
|
||||
for (var i = 0; i < names.length; i++) {
|
||||
@@ -77,33 +77,33 @@ class OkAnime extends MSourceProvider {
|
||||
animeList.add(anime);
|
||||
}
|
||||
final nextPage =
|
||||
MBridge.xpath(res, '//li[@class="page-item"]/a[@rel="next"]/@href');
|
||||
xpath(res, '//li[@class="page-item"]/a[@rel="next"]/@href');
|
||||
return MPages(animeList, nextPage.isNotEmpty);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MManga> getDetail(MSource sourceInfo, String url) async {
|
||||
Future<MManga> getDetail(MSource source, String url) async {
|
||||
final statusList = [
|
||||
{"يعرض الان": 0, "مكتمل": 1}
|
||||
];
|
||||
final data = {"url": url};
|
||||
final res = await MBridge.http('GET', json.encode(data));
|
||||
final res = await http('GET', json.encode(data));
|
||||
MManga anime = MManga();
|
||||
final status = MBridge.xpath(res,
|
||||
final status = xpath(res,
|
||||
'//*[@class="full-list-info" and contains(text(),"حالة الأنمي")]/small/a/text()');
|
||||
if (status.isNotEmpty) {
|
||||
anime.status = MBridge.parseStatus(status.first, statusList);
|
||||
anime.status = parseStatus(status.first, statusList);
|
||||
}
|
||||
anime.description =
|
||||
MBridge.xpath(res, '//*[@class="review-content"]/text()').first;
|
||||
xpath(res, '//*[@class="review-content"]/text()').first;
|
||||
|
||||
anime.genre =
|
||||
MBridge.xpath(res, '//*[@class="review-author-info"]/a/text()');
|
||||
final epUrls = MBridge.xpath(res,
|
||||
xpath(res, '//*[@class="review-author-info"]/a/text()');
|
||||
final epUrls = xpath(res,
|
||||
'//*[contains(@class,"anime-card")]/div[@class="anime-title")]/h5/a/@href')
|
||||
.reversed
|
||||
.toList();
|
||||
final names = MBridge.xpath(res,
|
||||
final names = xpath(res,
|
||||
'//*[contains(@class,"anime-card")]/div[@class="anime-title")]/h5/a/text()')
|
||||
.reversed
|
||||
.toList();
|
||||
@@ -121,12 +121,12 @@ class OkAnime extends MSourceProvider {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<MVideo>> getVideoList(MSource sourceInfo, String url) async {
|
||||
final res = await MBridge.http('GET', json.encode({"url": url}));
|
||||
Future<List<MVideo>> getVideoList(MSource source, String url) async {
|
||||
final res = await http('GET', json.encode({"url": url}));
|
||||
|
||||
final urls = MBridge.xpath(res, '//*[@id="streamlinks"]/a/@data-src');
|
||||
final urls = xpath(res, '//*[@id="streamlinks"]/a/@data-src');
|
||||
final qualities =
|
||||
MBridge.xpath(res, '//*[@id="streamlinks"]/a/span/text()');
|
||||
xpath(res, '//*[@id="streamlinks"]/a/span/text()');
|
||||
|
||||
List<MVideo> videos = [];
|
||||
for (var i = 0; i < urls.length; i++) {
|
||||
@@ -135,15 +135,15 @@ class OkAnime extends MSourceProvider {
|
||||
List<MVideo> a = [];
|
||||
|
||||
if (url.contains("https://doo")) {
|
||||
a = await MBridge.doodExtractor(url, "DoodStream - $quality");
|
||||
a = await doodExtractor(url, "DoodStream - $quality");
|
||||
} else if (url.contains("mp4upload")) {
|
||||
a = await MBridge.mp4UploadExtractor(url, null, "", "");
|
||||
a = await mp4UploadExtractor(url, null, "", "");
|
||||
} else if (url.contains("ok.ru")) {
|
||||
a = await MBridge.okruExtractor(url);
|
||||
a = await okruExtractor(url);
|
||||
} else if (url.contains("voe.sx")) {
|
||||
a = await MBridge.voeExtractor(url, "VoeSX $quality");
|
||||
a = await voeExtractor(url, "VoeSX $quality");
|
||||
} else if (containsVidBom(url)) {
|
||||
a = await MBridge.vidBomExtractor(url);
|
||||
a = await vidBomExtractor(url);
|
||||
}
|
||||
videos.addAll(a);
|
||||
}
|
||||
@@ -174,7 +174,7 @@ class OkAnime extends MSourceProvider {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<String>> getPageList(MSource sourceInfo, String url) async {
|
||||
Future<List<String>> getPageList(MSource source, String url) async {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
import 'package:mangayomi/bridge_lib.dart';
|
||||
import 'dart:convert';
|
||||
|
||||
class GogoAnime extends MSourceProvider {
|
||||
class GogoAnime extends MProvider {
|
||||
GogoAnime();
|
||||
|
||||
@override
|
||||
Future<MPages> getPopular(MSource sourceInfo, int page) async {
|
||||
final data = {"url": "${sourceInfo.baseUrl}/popular.html?page=$page"};
|
||||
final res = await MBridge.http('GET', json.encode(data));
|
||||
Future<MPages> getPopular(MSource source, int page) async {
|
||||
final data = {"url": "${source.baseUrl}/popular.html?page=$page"};
|
||||
final res = await http('GET', json.encode(data));
|
||||
|
||||
List<MManga> animeList = [];
|
||||
final urls = MBridge.xpath(res, '//*[@class="img"]/a/@href');
|
||||
final names = MBridge.xpath(res, '//*[@class="img"]/a/@title');
|
||||
final images = MBridge.xpath(res, '//*[@class="img"]/a/img/@src');
|
||||
final urls = xpath(res, '//*[@class="img"]/a/@href');
|
||||
final names = xpath(res, '//*[@class="img"]/a/@title');
|
||||
final images = xpath(res, '//*[@class="img"]/a/img/@src');
|
||||
|
||||
for (var i = 0; i < names.length; i++) {
|
||||
MManga anime = MManga();
|
||||
@@ -26,20 +26,20 @@ class GogoAnime extends MSourceProvider {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MPages> getLatestUpdates(MSource sourceInfo, int page) async {
|
||||
Future<MPages> getLatestUpdates(MSource source, int page) async {
|
||||
final data = {
|
||||
"url":
|
||||
"https://ajax.gogo-load.com/ajax/page-recent-release-ongoing.html?page=$page&type=1"
|
||||
};
|
||||
final res = await MBridge.http('GET', json.encode(data));
|
||||
final res = await http('GET', json.encode(data));
|
||||
|
||||
List<MManga> animeList = [];
|
||||
final urls = MBridge.xpath(
|
||||
final urls = xpath(
|
||||
res, '//*[@class="added_series_body popular"]/ul/li/a[1]/@href');
|
||||
final names = MBridge.xpath(
|
||||
final names = xpath(
|
||||
res, '//*[//*[@class="added_series_body popular"]/ul/li/a[1]/@title');
|
||||
List<String> images = [];
|
||||
List<String> imagess = MBridge.xpath(res,
|
||||
List<String> imagess = xpath(res,
|
||||
'//*[//*[@class="added_series_body popular"]/ul/li/a/div[@class="thumbnail-popular"]/@style');
|
||||
for (var url in imagess) {
|
||||
images.add(url.replaceAll("background: url('", "").replaceAll("');", ""));
|
||||
@@ -57,16 +57,16 @@ class GogoAnime extends MSourceProvider {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MPages> search(MSource sourceInfo, String query, int page) async {
|
||||
Future<MPages> search(MSource source, String query, int page) async {
|
||||
final data = {
|
||||
"url": "${sourceInfo.baseUrl}/search.html?keyword=$query&page=$page"
|
||||
"url": "${source.baseUrl}/search.html?keyword=$query&page=$page"
|
||||
};
|
||||
final res = await MBridge.http('GET', json.encode(data));
|
||||
final res = await http('GET', json.encode(data));
|
||||
|
||||
List<MManga> animeList = [];
|
||||
final urls = MBridge.xpath(res, '//*[@class="img"]/a/@href');
|
||||
final names = MBridge.xpath(res, '//*[@class="img"]/a/@title');
|
||||
final images = MBridge.xpath(res, '//*[@class="img"]/a/img/@src');
|
||||
final urls = xpath(res, '//*[@class="img"]/a/@href');
|
||||
final names = xpath(res, '//*[@class="img"]/a/@title');
|
||||
final images = xpath(res, '//*[@class="img"]/a/img/@src');
|
||||
|
||||
for (var i = 0; i < names.length; i++) {
|
||||
MManga anime = MManga();
|
||||
@@ -80,45 +80,45 @@ class GogoAnime extends MSourceProvider {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MManga> getDetail(MSource sourceInfo, String url) async {
|
||||
Future<MManga> getDetail(MSource source, String url) async {
|
||||
final statusList = [
|
||||
{
|
||||
"Ongoing": 0,
|
||||
"Completed": 1,
|
||||
}
|
||||
];
|
||||
final data = {"url": "${sourceInfo.baseUrl}$url"};
|
||||
final res = await MBridge.http('GET', json.encode(data));
|
||||
final data = {"url": "${source.baseUrl}$url"};
|
||||
final res = await http('GET', json.encode(data));
|
||||
MManga anime = MManga();
|
||||
final status = MBridge.xpath(
|
||||
final status = xpath(
|
||||
res, '//*[@class="anime_info_body_bg"]/p[@class="type"][5]/text()')
|
||||
.first
|
||||
.replaceAll("Status: ", "");
|
||||
anime.description = MBridge.xpath(
|
||||
anime.description = xpath(
|
||||
res, '//*[@class="anime_info_body_bg"]/p[@class="type"][2]/text()')
|
||||
.first
|
||||
.replaceAll("Plot Summary: ", "");
|
||||
anime.status = MBridge.parseStatus(status, statusList);
|
||||
anime.genre = MBridge.xpath(
|
||||
anime.status = parseStatus(status, statusList);
|
||||
anime.genre = xpath(
|
||||
res, '//*[@class="anime_info_body_bg"]/p[@class="type"][3]/text()')
|
||||
.first
|
||||
.replaceAll("Genre: ", "")
|
||||
.split(",");
|
||||
|
||||
final id = MBridge.xpath(res, '//*[@id="movie_id"]/@value').first;
|
||||
final id = xpath(res, '//*[@id="movie_id"]/@value').first;
|
||||
final urlEp =
|
||||
"https://ajax.gogo-load.com/ajax/load-list-episode?ep_start=0&ep_end=4000&id=$id";
|
||||
final dataEp = {"url": urlEp};
|
||||
final resEp = await MBridge.http('GET', json.encode(dataEp));
|
||||
final resEp = await http('GET', json.encode(dataEp));
|
||||
|
||||
final epUrls =
|
||||
MBridge.xpath(resEp, '//*[@id="episode_related"]/li/a/@href');
|
||||
final names = MBridge.xpath(
|
||||
xpath(resEp, '//*[@id="episode_related"]/li/a/@href');
|
||||
final names = xpath(
|
||||
resEp, '//*[@id="episode_related"]/li/a/div[@class="name"]/text()');
|
||||
List<String> episodes = [];
|
||||
|
||||
for (var a in names) {
|
||||
episodes.add("Episode ${MBridge.substringAfterLast(a, ' ')}");
|
||||
episodes.add("Episode ${substringAfterLast(a, ' ')}");
|
||||
}
|
||||
List<MChapter>? episodesList = [];
|
||||
for (var i = 0; i < episodes.length; i++) {
|
||||
@@ -133,27 +133,27 @@ class GogoAnime extends MSourceProvider {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<MVideo>> getVideoList(MSource sourceInfo, String url) async {
|
||||
final datas = {"url": "${sourceInfo.baseUrl}$url"};
|
||||
Future<List<MVideo>> getVideoList(MSource source, String url) async {
|
||||
final datas = {"url": "${source.baseUrl}$url"};
|
||||
|
||||
final res = await MBridge.http('GET', json.encode(datas));
|
||||
final res = await http('GET', json.encode(datas));
|
||||
final serverUrls =
|
||||
MBridge.xpath(res, '//*[@class="anime_muti_link"]/ul/li/a/@data-video');
|
||||
xpath(res, '//*[@class="anime_muti_link"]/ul/li/a/@data-video');
|
||||
final classNames =
|
||||
MBridge.xpath(res, '//*[@class="anime_muti_link"]/ul/li/@class');
|
||||
xpath(res, '//*[@class="anime_muti_link"]/ul/li/@class');
|
||||
List<MVideo> videos = [];
|
||||
for (var i = 0; i < classNames.length; i++) {
|
||||
final name = classNames[i];
|
||||
final url = serverUrls[i];
|
||||
List<MVideo> a = [];
|
||||
if (name.contains("anime")) {
|
||||
a = await MBridge.gogoCdnExtractor(url);
|
||||
a = await gogoCdnExtractor(url);
|
||||
} else if (name.contains("vidcdn")) {
|
||||
a = await MBridge.gogoCdnExtractor(url);
|
||||
a = await gogoCdnExtractor(url);
|
||||
} else if (name.contains("doodstream")) {
|
||||
a = await MBridge.doodExtractor(url);
|
||||
a = await doodExtractor(url);
|
||||
} else if (name.contains("mp4upload")) {
|
||||
a = await MBridge.mp4UploadExtractor(url, null, "", "");
|
||||
a = await mp4UploadExtractor(url, null, "", "");
|
||||
} else if (name.contains("streamsb")) {}
|
||||
videos.addAll(a);
|
||||
}
|
||||
@@ -162,7 +162,7 @@ class GogoAnime extends MSourceProvider {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<String>> getPageList(MSource sourceInfo, String url) async {
|
||||
Future<List<String>> getPageList(MSource source, String url) async {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import 'package:mangayomi/bridge_lib.dart';
|
||||
import 'dart:convert';
|
||||
|
||||
class KissKh extends MSourceProvider {
|
||||
class KissKh extends MProvider {
|
||||
KissKh();
|
||||
|
||||
@override
|
||||
Future<MPages> getPopular(MSource sourceInfo, int page) async {
|
||||
Future<MPages> getPopular(MSource source, int page) async {
|
||||
final data = {
|
||||
"url":
|
||||
"${sourceInfo.baseUrl}/api/DramaList/List?page=$page&type=0&sub=0&country=0&status=0&order=1&pageSize=40"
|
||||
"${source.baseUrl}/api/DramaList/List?page=$page&type=0&sub=0&country=0&status=0&order=1&pageSize=40"
|
||||
};
|
||||
final res = await MBridge.http('GET', json.encode(data));
|
||||
final res = await http('GET', json.encode(data));
|
||||
final jsonRes = json.decode(res);
|
||||
final datas = jsonRes["data"] as List;
|
||||
List<MManga> animeList = [];
|
||||
@@ -20,7 +20,7 @@ class KissKh extends MSourceProvider {
|
||||
anime.name = data["title"];
|
||||
anime.imageUrl = data["thumbnail"] ?? "";
|
||||
anime.link =
|
||||
"${sourceInfo.baseUrl}/api/DramaList/Drama/${data["id"]}?isq=false";
|
||||
"${source.baseUrl}/api/DramaList/Drama/${data["id"]}?isq=false";
|
||||
animeList.add(anime);
|
||||
}
|
||||
|
||||
@@ -30,13 +30,13 @@ class KissKh extends MSourceProvider {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MPages> getLatestUpdates(MSource sourceInfo, int page) async {
|
||||
Future<MPages> getLatestUpdates(MSource source, int page) async {
|
||||
final data = {
|
||||
"url":
|
||||
"${sourceInfo.baseUrl}/api/DramaList/List?page=$page&type=0&sub=0&country=0&status=0&order=12&pageSize=40",
|
||||
"${source.baseUrl}/api/DramaList/List?page=$page&type=0&sub=0&country=0&status=0&order=12&pageSize=40",
|
||||
"header": {"ee": "eee"}
|
||||
};
|
||||
final res = await MBridge.http('GET', json.encode(data));
|
||||
final res = await http('GET', json.encode(data));
|
||||
final jsonRes = json.decode(res);
|
||||
final datas = jsonRes["data"] as List;
|
||||
|
||||
@@ -47,7 +47,7 @@ class KissKh extends MSourceProvider {
|
||||
anime.name = data["title"];
|
||||
anime.imageUrl = data["thumbnail"] ?? "";
|
||||
anime.link =
|
||||
"${sourceInfo.baseUrl}/api/DramaList/Drama/${data["id"]}?isq=false";
|
||||
"${source.baseUrl}/api/DramaList/Drama/${data["id"]}?isq=false";
|
||||
animeList.add(anime);
|
||||
}
|
||||
|
||||
@@ -57,11 +57,11 @@ class KissKh extends MSourceProvider {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MPages> search(MSource sourceInfo, String query, int page) async {
|
||||
Future<MPages> search(MSource source, String query, int page) async {
|
||||
final data = {
|
||||
"url": "${sourceInfo.baseUrl}/api/DramaList/Search?q=$query&type=0"
|
||||
"url": "${source.baseUrl}/api/DramaList/Search?q=$query&type=0"
|
||||
};
|
||||
final res = await MBridge.http('GET', json.encode(data));
|
||||
final res = await http('GET', json.encode(data));
|
||||
final jsonRes = json.decode(res);
|
||||
List<MManga> animeList = [];
|
||||
for (var data in jsonRes) {
|
||||
@@ -69,14 +69,14 @@ class KissKh extends MSourceProvider {
|
||||
anime.name = data["title"];
|
||||
anime.imageUrl = data["thumbnail"] ?? "";
|
||||
anime.link =
|
||||
"${sourceInfo.baseUrl}/api/DramaList/Drama/${data["id"]}?isq=false";
|
||||
"${source.baseUrl}/api/DramaList/Drama/${data["id"]}?isq=false";
|
||||
animeList.add(anime);
|
||||
}
|
||||
return MPages(animeList, false);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MManga> getDetail(MSource sourceInfo, String url) async {
|
||||
Future<MManga> getDetail(MSource source, String url) async {
|
||||
final statusList = [
|
||||
{
|
||||
"Ongoing": 0,
|
||||
@@ -84,13 +84,13 @@ class KissKh extends MSourceProvider {
|
||||
}
|
||||
];
|
||||
final data = {"url": url};
|
||||
final res = await MBridge.http('GET', json.encode(data));
|
||||
final res = await http('GET', json.encode(data));
|
||||
MManga anime = MManga();
|
||||
final jsonRes = json.decode(res);
|
||||
final status = jsonRes["status"] ?? "";
|
||||
print(status);
|
||||
anime.description = jsonRes["description"];
|
||||
anime.status = MBridge.parseStatus(status, statusList);
|
||||
anime.status = parseStatus(status, statusList);
|
||||
anime.imageUrl = jsonRes["thumbnail"];
|
||||
var episodes = jsonRes["episodes"];
|
||||
String type = jsonRes["type"];
|
||||
@@ -113,7 +113,7 @@ class KissKh extends MSourceProvider {
|
||||
episode.name = "Episode $number";
|
||||
}
|
||||
episode.url =
|
||||
"${sourceInfo.baseUrl}/api/DramaList/Episode/$id.png?err=false&ts=&time=";
|
||||
"${source.baseUrl}/api/DramaList/Episode/$id.png?err=false&ts=&time=";
|
||||
episodesList.add(episode);
|
||||
}
|
||||
|
||||
@@ -122,16 +122,16 @@ class KissKh extends MSourceProvider {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<MVideo>> getVideoList(MSource sourceInfo, String url) async {
|
||||
Future<List<MVideo>> getVideoList(MSource source, String url) async {
|
||||
final datas = {"url": url};
|
||||
|
||||
final res = await MBridge.http('GET', json.encode(datas));
|
||||
final id = MBridge.substringAfter(
|
||||
MBridge.substringBefore(url, ".png"), "Episode/");
|
||||
final res = await http('GET', json.encode(datas));
|
||||
final id = substringAfter(
|
||||
substringBefore(url, ".png"), "Episode/");
|
||||
final jsonRes = json.decode(res);
|
||||
|
||||
final subRes = await MBridge.http(
|
||||
'GET', json.encode({"url": "${sourceInfo.baseUrl}/api/Sub/$id"}));
|
||||
final subRes = await http(
|
||||
'GET', json.encode({"url": "${source.baseUrl}/api/Sub/$id"}));
|
||||
var jsonSubRes = json.decode(subRes);
|
||||
|
||||
List<MTrack> subtitles = [];
|
||||
@@ -162,7 +162,7 @@ class KissKh extends MSourceProvider {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<String>> getPageList(MSource sourceInfo, String url) async {
|
||||
Future<List<String>> getPageList(MSource source, String url) async {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
import 'package:mangayomi/bridge_lib.dart';
|
||||
import 'dart:convert';
|
||||
|
||||
class AnimesUltra extends MSourceProvider {
|
||||
class AnimesUltra extends MProvider {
|
||||
AnimesUltra();
|
||||
|
||||
@override
|
||||
Future<MPages> getPopular(MSource sourceInfo, int page) async {
|
||||
final data = {"url": "${sourceInfo.baseUrl}/"};
|
||||
final res = await MBridge.http('GET', json.encode(data));
|
||||
Future<MPages> getPopular(MSource source, int page) async {
|
||||
final data = {"url": "${source.baseUrl}/"};
|
||||
final res = await http('GET', json.encode(data));
|
||||
|
||||
List<MManga> animeList = [];
|
||||
final urls = MBridge.xpath(res,
|
||||
final urls = xpath(res,
|
||||
'//*[contains(@class,"swiper-slide item-qtip")]/div[@class="item"]/a/@href');
|
||||
final names = MBridge.xpath(res,
|
||||
final names = xpath(res,
|
||||
'//*[contains(@class,"swiper-slide item-qtip")]/div[@class="item"]/a/img/@title');
|
||||
final images = MBridge.xpath(res,
|
||||
final images = xpath(res,
|
||||
'//*[contains(@class,"swiper-slide item-qtip")]/div[@class="item"]/a/img/@data-src');
|
||||
|
||||
for (var i = 0; i < names.length; i++) {
|
||||
@@ -29,16 +29,16 @@ class AnimesUltra extends MSourceProvider {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MPages> getLatestUpdates(MSource sourceInfo, int page) async {
|
||||
final data = {"url": "${sourceInfo.baseUrl}/"};
|
||||
final res = await MBridge.http('GET', json.encode(data));
|
||||
Future<MPages> getLatestUpdates(MSource source, int page) async {
|
||||
final data = {"url": "${source.baseUrl}/"};
|
||||
final res = await http('GET', json.encode(data));
|
||||
|
||||
List<MManga> animeList = [];
|
||||
final urls = MBridge.xpath(res,
|
||||
final urls = xpath(res,
|
||||
'//*[@class="block_area block_area_home"]/div[@class="tab-content"]/div[contains(@class,"block_area-content block_area-list")]/div[@class="film_list-wrap"]/div[@class="flw-item"]/div[@class="film-poster"]/a/@href');
|
||||
final names = MBridge.xpath(res,
|
||||
final names = xpath(res,
|
||||
'//*[@class="block_area block_area_home"]/div[@class="tab-content"]/div[contains(@class,"block_area-content block_area-list")]/div[@class="film_list-wrap"]/div[@class="flw-item"]/div[@class="film-poster"]/a/@title');
|
||||
final images = MBridge.xpath(res,
|
||||
final images = xpath(res,
|
||||
'//*[@class="block_area block_area_home"]/div[@class="tab-content"]/div[contains(@class,"block_area-content block_area-list")]/div[@class="film_list-wrap"]/div[@class="flw-item"]/div[@class="film-poster"]/img/@data-src');
|
||||
|
||||
for (var i = 0; i < names.length; i++) {
|
||||
@@ -53,15 +53,15 @@ class AnimesUltra extends MSourceProvider {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MPages> search(MSource sourceInfo, String query, int page) async {
|
||||
final data = {"url": "${sourceInfo.baseUrl}/"};
|
||||
final res = await MBridge.http('GET', json.encode(data));
|
||||
Future<MPages> search(MSource source, String query, int page) async {
|
||||
final data = {"url": "${source.baseUrl}/"};
|
||||
final res = await http('GET', json.encode(data));
|
||||
|
||||
List<MManga> animeList = [];
|
||||
final urls = MBridge.xpath(res, '//*[@class="film-poster"]/a/@href');
|
||||
final names = MBridge.xpath(res, '//*[@class="film-poster"]/a/@title');
|
||||
final urls = xpath(res, '//*[@class="film-poster"]/a/@href');
|
||||
final names = xpath(res, '//*[@class="film-poster"]/a/@title');
|
||||
final images =
|
||||
MBridge.xpath(res, '//*[@class="film-poster"]/img/@data-src');
|
||||
xpath(res, '//*[@class="film-poster"]/img/@data-src');
|
||||
|
||||
for (var i = 0; i < names.length; i++) {
|
||||
MManga anime = MManga();
|
||||
@@ -75,7 +75,7 @@ class AnimesUltra extends MSourceProvider {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MManga> getDetail(MSource sourceInfo, String url) async {
|
||||
Future<MManga> getDetail(MSource source, String url) async {
|
||||
final statusList = [
|
||||
{
|
||||
"En cours": 0,
|
||||
@@ -83,28 +83,28 @@ class AnimesUltra extends MSourceProvider {
|
||||
}
|
||||
];
|
||||
final data = {"url": url};
|
||||
final res = await MBridge.http('GET', json.encode(data));
|
||||
final res = await http('GET', json.encode(data));
|
||||
MManga anime = MManga();
|
||||
anime.description =
|
||||
MBridge.xpath(res, '//*[@class="film-description m-hide"]/text()')
|
||||
xpath(res, '//*[@class="film-description m-hide"]/text()')
|
||||
.first;
|
||||
|
||||
final status = MBridge.xpath(res,
|
||||
final status = xpath(res,
|
||||
'//*[@class="item item-title" and contains(text(),"Status:")]/span[2]/text()')
|
||||
.first;
|
||||
anime.status = MBridge.parseStatus(status, statusList);
|
||||
anime.genre = MBridge.xpath(res,
|
||||
anime.status = parseStatus(status, statusList);
|
||||
anime.genre = xpath(res,
|
||||
'//*[@class="item item-list" and contains(text(),"Genres:")]/a/text()');
|
||||
anime.author = MBridge.xpath(res,
|
||||
anime.author = xpath(res,
|
||||
'//*[@class="item item-title" and contains(text(),"Studio:")]/span[2]/text()')
|
||||
.first;
|
||||
final urlEp = url.replaceAll('.html', '/episode-1.html');
|
||||
final resEpWebview =
|
||||
await MBridge.getHtmlViaWebview(urlEp, '//*[@class="ss-list"]/a/@href');
|
||||
final epUrls = MBridge.xpath(resEpWebview, '//*[@class="ss-list"]/a/@href')
|
||||
await getHtmlViaWebview(urlEp, '//*[@class="ss-list"]/a/@href');
|
||||
final epUrls = xpath(resEpWebview, '//*[@class="ss-list"]/a/@href')
|
||||
.reversed
|
||||
.toList();
|
||||
final names = MBridge.xpath(resEpWebview,
|
||||
final names = xpath(resEpWebview,
|
||||
'//*[@class="ss-list"]/a/div[@class="ssli-detail"]/div/text()')
|
||||
.reversed
|
||||
.toList();
|
||||
@@ -122,18 +122,18 @@ class AnimesUltra extends MSourceProvider {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<MVideo>> getVideoList(MSource sourceInfo, String url) async {
|
||||
final resWebview = await MBridge.getHtmlViaWebview(
|
||||
Future<List<MVideo>> getVideoList(MSource source, String url) async {
|
||||
final resWebview = await getHtmlViaWebview(
|
||||
url, '//*[@class="ps__-list"]/div/@data-server-id');
|
||||
|
||||
final serverIds = MBridge.xpath(
|
||||
final serverIds = xpath(
|
||||
resWebview, '//*[@class="ps__-list"]/div/@data-server-id');
|
||||
final serverNames =
|
||||
MBridge.xpath(resWebview, '//*[@class="ps__-list"]/div/a/text()');
|
||||
xpath(resWebview, '//*[@class="ps__-list"]/div/a/text()');
|
||||
List<String> serverUrls = [];
|
||||
for (var id in serverIds) {
|
||||
final serversUrls =
|
||||
MBridge.xpath(resWebview, '//*[@id="content_player_${id}"]/text()')
|
||||
xpath(resWebview, '//*[@id="content_player_${id}"]/text()')
|
||||
.first;
|
||||
serverUrls.add(serversUrls);
|
||||
}
|
||||
@@ -144,15 +144,15 @@ class AnimesUltra extends MSourceProvider {
|
||||
|
||||
List<MVideo> a = [];
|
||||
if (name.contains("Sendvid")) {
|
||||
a = await MBridge.sendVidExtractor(
|
||||
a = await sendVidExtractor(
|
||||
url.replaceAll("https:////", "https://"),
|
||||
json.encode({"Referer": "${sourceInfo.baseUrl}/"}),
|
||||
json.encode({"Referer": "${source.baseUrl}/"}),
|
||||
"");
|
||||
} else if (name.contains("Sibnet")) {
|
||||
a = await MBridge.sibnetExtractor(
|
||||
a = await sibnetExtractor(
|
||||
"https://video.sibnet.ru/shell.php?videoid=$url");
|
||||
} else if (name.contains("Mytv")) {
|
||||
a = await MBridge.myTvExtractor("https://www.myvi.tv/embed/$url");
|
||||
a = await myTvExtractor("https://www.myvi.tv/embed/$url");
|
||||
}
|
||||
videos.addAll(a);
|
||||
}
|
||||
@@ -161,7 +161,7 @@ class AnimesUltra extends MSourceProvider {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<String>> getPageList(MSource sourceInfo, String url) async {
|
||||
Future<List<String>> getPageList(MSource source, String url) async {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +1,22 @@
|
||||
import 'package:mangayomi/bridge_lib.dart';
|
||||
import 'package:mangayomi/utils.dart';
|
||||
import 'dart:convert';
|
||||
|
||||
class FrAnime extends MSourceProvider {
|
||||
class FrAnime extends MProvider {
|
||||
FrAnime();
|
||||
|
||||
@override
|
||||
Future<MPages> getPopular(MSource sourceInfo, int page) async {
|
||||
Future<MPages> getPopular(MSource source, int page) async {
|
||||
final data = {
|
||||
"url": "https://api.franime.fr/api/animes/",
|
||||
"headers": {"Referer": "https://franime.fr/"}
|
||||
};
|
||||
final res = await MBridge.http('GET', json.encode(data));
|
||||
final res = await http('GET', json.encode(data));
|
||||
|
||||
return animeResList(res);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MPages> getLatestUpdates(MSource sourceInfo, int page) async {
|
||||
Future<MPages> getLatestUpdates(MSource source, int page) async {
|
||||
final res = await dataBase();
|
||||
|
||||
List list = json.decode(res);
|
||||
@@ -25,23 +24,20 @@ class FrAnime extends MSourceProvider {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MPages> search(MSource sourceInfo, String query, int page) async {
|
||||
Future<MPages> search(MSource source, String query, int page) async {
|
||||
final res = await dataBase();
|
||||
|
||||
return animeSeachFetch(res, query);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MManga> getDetail(MSource sourceInfo, String url) async {
|
||||
Future<MManga> getDetail(MSource source, String url) async {
|
||||
MManga anime = MManga();
|
||||
String language = "vo".toString();
|
||||
if (url.contains("lang=")) {
|
||||
language =
|
||||
Substring(url).substringAfter("lang=").substringBefore("&").text;
|
||||
print(language);
|
||||
language = substringBefore(substringAfter(url, "lang="), "&");
|
||||
}
|
||||
String stem =
|
||||
Substring(url).substringAfterLast("/").substringBefore("?").text;
|
||||
String stem = substringBefore(substringAfterLast(url, "/"), "?");
|
||||
final res = await dataBase();
|
||||
|
||||
final animeByTitleOJson = databaseAnimeByTitleO(res, stem);
|
||||
@@ -50,8 +46,8 @@ class FrAnime extends MSourceProvider {
|
||||
var seasonsJson = seasons.first;
|
||||
|
||||
if (url.contains("s=")) {
|
||||
int seasonNumber = int.parse(
|
||||
Substring(url).substringAfter("s=").substringBefore("&").text);
|
||||
int seasonNumber =
|
||||
int.parse(substringBefore(substringAfter(url, "s="), "&"));
|
||||
seasonsJson = seasons[seasonNumber - 1];
|
||||
}
|
||||
|
||||
@@ -84,21 +80,18 @@ class FrAnime extends MSourceProvider {
|
||||
}
|
||||
}
|
||||
|
||||
anime.chapters = episodesList;
|
||||
anime.chapters = episodesList.reversed.toList();
|
||||
return anime;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<MVideo>> getVideoList(MSource sourceInfo, String url) async {
|
||||
Future<List<MVideo>> getVideoList(MSource source, String url) async {
|
||||
String language = "vo".toString();
|
||||
String videoBaseUrl = "https://api.franime.fr/api/anime".toString();
|
||||
if (url.contains("lang=")) {
|
||||
language =
|
||||
Substring(url).substringAfter("lang=").substringBefore("&").text;
|
||||
print(language);
|
||||
language = substringBefore(substringAfter(url, "lang="), "&");
|
||||
}
|
||||
String stem =
|
||||
Substring(url).substringAfterLast("/").substringBefore("?").text;
|
||||
String stem = substringBefore(substringAfterLast(url, "/"), "?");
|
||||
final res = await dataBase();
|
||||
|
||||
final animeByTitleOJson = databaseAnimeByTitleO(res, stem);
|
||||
@@ -110,8 +103,8 @@ class FrAnime extends MSourceProvider {
|
||||
videoBaseUrl += "/$animeId/";
|
||||
|
||||
if (url.contains("s=")) {
|
||||
int seasonNumber = int.parse(
|
||||
Substring(url).substringAfter("s=").substringBefore("&").text);
|
||||
int seasonNumber =
|
||||
int.parse(substringBefore(substringAfter(url, "s="), "&"));
|
||||
print(seasonNumber);
|
||||
videoBaseUrl += "${seasonNumber - 1}/";
|
||||
seasonsJson = seasons[seasonNumber - 1];
|
||||
@@ -121,7 +114,7 @@ class FrAnime extends MSourceProvider {
|
||||
final episodesJson = seasonsJson["episodes"];
|
||||
var episode = episodesJson.first;
|
||||
if (url.contains("ep=")) {
|
||||
int episodeNumber = int.parse(Substring(url).substringAfter("ep=").text);
|
||||
int episodeNumber = int.parse(substringAfter(url, "ep="));
|
||||
print(episodeNumber);
|
||||
episode = episodesJson[episodeNumber - 1];
|
||||
videoBaseUrl += "${episodeNumber - 1}";
|
||||
@@ -153,7 +146,7 @@ class FrAnime extends MSourceProvider {
|
||||
"url": apiUrl,
|
||||
"headers": {"Referer": "https://franime.fr/"}
|
||||
};
|
||||
final playerUrl = await MBridge.http('GET', json.encode(data));
|
||||
final playerUrl = await http('GET', json.encode(data));
|
||||
|
||||
List<MVideo> a = [];
|
||||
if (playerName.contains("vido")) {
|
||||
@@ -162,13 +155,13 @@ class FrAnime extends MSourceProvider {
|
||||
..originalUrl = playerUrl
|
||||
..quality = "FRAnime (Vido)");
|
||||
} else if (playerName.contains("myvi")) {
|
||||
a = await MBridge.myTvExtractor(playerUrl);
|
||||
a = await myTvExtractor(playerUrl);
|
||||
} else if (playerName.contains("sendvid")) {
|
||||
a = await MBridge.sendVidExtractor(
|
||||
a = await sendVidExtractor(
|
||||
playerUrl, json.encode({"Referer": "https://franime.fr/"}), "");
|
||||
} else if (playerName.contains("sibnet")) {
|
||||
a = await MBridge.sibnetExtractor(playerUrl);
|
||||
}
|
||||
a = await sibnetExtractor(playerUrl);
|
||||
}
|
||||
videos.addAll(a);
|
||||
}
|
||||
|
||||
@@ -176,7 +169,7 @@ class FrAnime extends MSourceProvider {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<String>> getPageList(MSource sourceInfo, String url) async {
|
||||
Future<List<String>> getPageList(MSource source, String url) async {
|
||||
return [];
|
||||
}
|
||||
|
||||
@@ -206,7 +199,7 @@ class FrAnime extends MSourceProvider {
|
||||
final title = animeJson["title"];
|
||||
final genre = animeJson["themes"];
|
||||
final description = animeJson["description"];
|
||||
final status = MBridge.parseStatus(animeJson["status"], statusList);
|
||||
final status = parseStatus(animeJson["status"], statusList);
|
||||
final imageUrl = animeJson["affiche"];
|
||||
bool hasVostfr = vostfrListName.contains(true);
|
||||
bool hasVf = vfListName.contains(true);
|
||||
@@ -239,7 +232,7 @@ class FrAnime extends MSourceProvider {
|
||||
anime.name = seasonTitle;
|
||||
anime.imageUrl = imageUrl;
|
||||
anime.link =
|
||||
"/anime/${MBridge.regExp(titleO, "[^A-Za-z0-9 ]", "", 0, 0).replaceAll(" ", "-").toLowerCase()}?lang=$lang&s=$ind";
|
||||
"/anime/${regExp(titleO, "[^A-Za-z0-9 ]", "", 0, 0).replaceAll(" ", "-").toLowerCase()}?lang=$lang&s=$ind";
|
||||
|
||||
animeList.add(anime);
|
||||
}
|
||||
@@ -257,18 +250,18 @@ class FrAnime extends MSourceProvider {
|
||||
for (var animeJson in jsonResList) {
|
||||
MManga anime = MManga();
|
||||
|
||||
final titleO = MBridge.getMapValue(json.encode(animeJson), "titleO");
|
||||
final titleO = getMapValue(json.encode(animeJson), "titleO");
|
||||
final titleAlt =
|
||||
MBridge.getMapValue(json.encode(animeJson), "titles", encode: true);
|
||||
final containsEn = MBridge.getMapValue(titleAlt, "en")
|
||||
getMapValue(json.encode(animeJson), "titles", encode: true);
|
||||
final containsEn = getMapValue(titleAlt, "en")
|
||||
.toString()
|
||||
.toLowerCase()
|
||||
.contains(query.toLowerCase());
|
||||
final containsEnJp = MBridge.getMapValue(titleAlt, "en_jp")
|
||||
final containsEnJp = getMapValue(titleAlt, "en_jp")
|
||||
.toString()
|
||||
.toLowerCase()
|
||||
.contains(query.toLowerCase());
|
||||
final containsJaJp = MBridge.getMapValue(titleAlt, "ja_jp")
|
||||
final containsJaJp = getMapValue(titleAlt, "ja_jp")
|
||||
.toString()
|
||||
.toLowerCase()
|
||||
.contains(query.toLowerCase());
|
||||
@@ -291,7 +284,7 @@ class FrAnime extends MSourceProvider {
|
||||
final title = animeJson["title"];
|
||||
final genre = animeJson["themes"];
|
||||
final description = animeJson["description"];
|
||||
final status = MBridge.parseStatus(animeJson["status"], statusList);
|
||||
final status = parseStatus(animeJson["status"], statusList);
|
||||
final imageUrl = animeJson["affiche"];
|
||||
|
||||
bool hasVostfr = vostfrListName.contains(true);
|
||||
@@ -325,7 +318,7 @@ class FrAnime extends MSourceProvider {
|
||||
anime.name = seasonTitle;
|
||||
anime.imageUrl = imageUrl;
|
||||
anime.link =
|
||||
"/anime/${MBridge.regExp(titleO, "[^A-Za-z0-9 ]", "", 0, 0).replaceAll(" ", "-").toLowerCase()}?lang=$lang&s=$ind";
|
||||
"/anime/${regExp(titleO, "[^A-Za-z0-9 ]", "", 0, 0).replaceAll(" ", "-").toLowerCase()}?lang=$lang&s=$ind";
|
||||
|
||||
animeList.add(anime);
|
||||
}
|
||||
@@ -341,18 +334,18 @@ class FrAnime extends MSourceProvider {
|
||||
"headers": {"Referer": "https://franime.fr/"}
|
||||
};
|
||||
|
||||
return await MBridge.http('GET', json.encode(data));
|
||||
return await http('GET', json.encode(data));
|
||||
}
|
||||
|
||||
String databaseAnimeByTitleO(String res, String titleO) {
|
||||
final datas = MBridge.jsonDecodeToList(res, 1);
|
||||
print(titleO);
|
||||
final datas = json.decode(res) as List;
|
||||
for (var data in datas) {
|
||||
if (MBridge.regExp(MBridge.getMapValue(data, "titleO"), "[^A-Za-z0-9 ]",
|
||||
"", 0, 0)
|
||||
if (regExp(data["titleO"], "[^A-Za-z0-9 ]", "", 0, 0)
|
||||
.replaceAll(" ", "-")
|
||||
.toLowerCase() ==
|
||||
"${titleO}") {
|
||||
return data;
|
||||
return json.encode(data);
|
||||
}
|
||||
}
|
||||
return "";
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
import 'package:mangayomi/bridge_lib.dart';
|
||||
import 'dart:convert';
|
||||
|
||||
class OtakuFr extends MSourceProvider {
|
||||
class OtakuFr extends MProvider {
|
||||
OtakuFr();
|
||||
|
||||
@override
|
||||
Future<MPages> getPopular(MSource sourceInfo, int page) async {
|
||||
Future<MPages> getPopular(MSource source, int page) async {
|
||||
final data = {
|
||||
"url": "${sourceInfo.baseUrl}/toute-la-liste-affiches/page/$page/?q=."
|
||||
"url": "${source.baseUrl}/toute-la-liste-affiches/page/$page/?q=."
|
||||
};
|
||||
final res = await MBridge.http('GET', json.encode(data));
|
||||
final res = await http('GET', json.encode(data));
|
||||
|
||||
List<MManga> animeList = [];
|
||||
final urls =
|
||||
MBridge.xpath(res, '//*[@class="list"]/article/div/div/figure/a/@href');
|
||||
final names = MBridge.xpath(
|
||||
xpath(res, '//*[@class="list"]/article/div/div/figure/a/@href');
|
||||
final names = xpath(
|
||||
res, '//*[@class="list"]/article/div/div/figure/a/img/@title');
|
||||
final images = MBridge.xpath(
|
||||
final images = xpath(
|
||||
res, '//*[@class="list"]/article/div/div/figure/a/img/@src');
|
||||
|
||||
for (var i = 0; i < names.length; i++) {
|
||||
@@ -26,21 +26,21 @@ class OtakuFr extends MSourceProvider {
|
||||
anime.link = urls[i];
|
||||
animeList.add(anime);
|
||||
}
|
||||
final nextPage = MBridge.xpath(res, '//a[@class="next page-link"]/@href');
|
||||
final nextPage = xpath(res, '//a[@class="next page-link"]/@href');
|
||||
return MPages(animeList, nextPage.isNotEmpty);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MPages> getLatestUpdates(MSource sourceInfo, int page) async {
|
||||
final data = {"url": "${sourceInfo.baseUrl}/page/$page/"};
|
||||
final res = await MBridge.http('GET', json.encode(data));
|
||||
Future<MPages> getLatestUpdates(MSource source, int page) async {
|
||||
final data = {"url": "${source.baseUrl}/page/$page/"};
|
||||
final res = await http('GET', json.encode(data));
|
||||
|
||||
List<MManga> animeList = [];
|
||||
final urls = MBridge.xpath(res, '//*[@class="episode"]/div/a/@href');
|
||||
final namess = MBridge.xpath(res, '//*[@class="episode"]/div/a/text()');
|
||||
final urls = xpath(res, '//*[@class="episode"]/div/a/@href');
|
||||
final namess = xpath(res, '//*[@class="episode"]/div/a/text()');
|
||||
List<String> names = [];
|
||||
for (var name in namess) {
|
||||
names.add(MBridge.regExp(
|
||||
names.add(regExp(
|
||||
name,
|
||||
r'(?<=\bS\d\s*|)\d{2}\s*(?=\b(Vostfr|vostfr|VF|Vf|vf|\(VF\)|\(vf\)|\(Vf\)|\(Vostfr\)\b))?',
|
||||
'',
|
||||
@@ -58,7 +58,7 @@ class OtakuFr extends MSourceProvider {
|
||||
.replaceAll(' (Vostfr)', ''));
|
||||
}
|
||||
final images =
|
||||
MBridge.xpath(res, '//*[@class="episode"]/div/figure/a/img/@src');
|
||||
xpath(res, '//*[@class="episode"]/div/figure/a/img/@src');
|
||||
|
||||
for (var i = 0; i < names.length; i++) {
|
||||
MManga anime = MManga();
|
||||
@@ -67,24 +67,24 @@ class OtakuFr extends MSourceProvider {
|
||||
anime.link = urls[i];
|
||||
animeList.add(anime);
|
||||
}
|
||||
final nextPage = MBridge.xpath(res, '//a[@class="next page-link"]/@href');
|
||||
final nextPage = xpath(res, '//a[@class="next page-link"]/@href');
|
||||
return MPages(animeList, nextPage.isNotEmpty);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MPages> search(MSource sourceInfo, String query, int page) async {
|
||||
Future<MPages> search(MSource source, String query, int page) async {
|
||||
final data = {
|
||||
"url":
|
||||
"${sourceInfo.baseUrl}/toute-la-liste-affiches/page/$page/?q=$query"
|
||||
"${source.baseUrl}/toute-la-liste-affiches/page/$page/?q=$query"
|
||||
};
|
||||
final res = await MBridge.http('GET', json.encode(data));
|
||||
final res = await http('GET', json.encode(data));
|
||||
|
||||
List<MManga> animeList = [];
|
||||
final urls =
|
||||
MBridge.xpath(res, '//*[@class="list"]/article/div/div/figure/a/@href');
|
||||
final names = MBridge.xpath(
|
||||
xpath(res, '//*[@class="list"]/article/div/div/figure/a/@href');
|
||||
final names = xpath(
|
||||
res, '//*[@class="list"]/article/div/div/figure/a/img/@title');
|
||||
final images = MBridge.xpath(
|
||||
final images = xpath(
|
||||
res, '//*[@class="list"]/article/div/div/figure/a/img/@src');
|
||||
|
||||
for (var i = 0; i < names.length; i++) {
|
||||
@@ -94,12 +94,12 @@ class OtakuFr extends MSourceProvider {
|
||||
anime.link = urls[i];
|
||||
animeList.add(anime);
|
||||
}
|
||||
final nextPage = MBridge.xpath(res, '//a[@class="next page-link"]/@href');
|
||||
final nextPage = xpath(res, '//a[@class="next page-link"]/@href');
|
||||
return MPages(animeList, nextPage.isNotEmpty);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MManga> getDetail(MSource sourceInfo, String url) async {
|
||||
Future<MManga> getDetail(MSource source, String url) async {
|
||||
final statusList = [
|
||||
{
|
||||
"En cours": 0,
|
||||
@@ -107,43 +107,43 @@ class OtakuFr extends MSourceProvider {
|
||||
}
|
||||
];
|
||||
final data = {"url": url};
|
||||
String res = await MBridge.http('GET', json.encode(data));
|
||||
String res = await http('GET', json.encode(data));
|
||||
MManga anime = MManga();
|
||||
final originalUrl = MBridge.xpath(res,
|
||||
final originalUrl = xpath(res,
|
||||
'//*[@class="breadcrumb"]/li[@class="breadcrumb-item"][2]/a/@href')
|
||||
.first;
|
||||
if (originalUrl.isNotEmpty) {
|
||||
final newData = {"url": originalUrl};
|
||||
res = await MBridge.http('GET', json.encode(newData));
|
||||
res = await http('GET', json.encode(newData));
|
||||
}
|
||||
|
||||
anime.description =
|
||||
MBridge.xpath(res, '//*[@class="episode fz-sm synop"]/p/text()')
|
||||
xpath(res, '//*[@class="episode fz-sm synop"]/p/text()')
|
||||
.first
|
||||
.replaceAll("Synopsis:", "");
|
||||
final status = MBridge.xpath(res,
|
||||
final status = xpath(res,
|
||||
'//*[@class="list-unstyled"]/li[contains(text(),"Statut")]/text()')
|
||||
.first
|
||||
.replaceAll("Statut: ", "");
|
||||
anime.status = MBridge.parseStatus(status, statusList);
|
||||
anime.genre = MBridge.xpath(res,
|
||||
anime.status = parseStatus(status, statusList);
|
||||
anime.genre = xpath(res,
|
||||
'//*[@class="list-unstyled"]/li[contains(text(),"Genre")]/ul/li/a/text()');
|
||||
|
||||
final epUrls =
|
||||
MBridge.xpath(res, '//*[@class="list-episodes list-group"]/a/@href');
|
||||
final dates = MBridge.xpath(
|
||||
xpath(res, '//*[@class="list-episodes list-group"]/a/@href');
|
||||
final dates = xpath(
|
||||
res, '//*[@class="list-episodes list-group"]/a/span/text()');
|
||||
final names =
|
||||
MBridge.xpath(res, '//*[@class="list-episodes list-group"]/a/text()');
|
||||
xpath(res, '//*[@class="list-episodes list-group"]/a/text()');
|
||||
List<String> episodes = [];
|
||||
|
||||
for (var i = 0; i < names.length; i++) {
|
||||
final date = dates[i];
|
||||
final name = names[i];
|
||||
episodes.add(
|
||||
"Episode ${MBridge.regExp(name.replaceAll(date, ""), r".* (\d*) [VvfF]{1,1}", '', 1, 1)}");
|
||||
"Episode ${regExp(name.replaceAll(date, ""), r".* (\d*) [VvfF]{1,1}", '', 1, 1)}");
|
||||
}
|
||||
final dateUploads = MBridge.parseDates(dates, "dd MMMM yyyy", "fr");
|
||||
final dateUploads = parseDates(dates, "dd MMMM yyyy", "fr");
|
||||
|
||||
List<MChapter>? episodesList = [];
|
||||
for (var i = 0; i < episodes.length; i++) {
|
||||
@@ -159,11 +159,11 @@ class OtakuFr extends MSourceProvider {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<MVideo>> getVideoList(MSource sourceInfo, String url) async {
|
||||
final res = await MBridge.http('GET', json.encode({"url": url}));
|
||||
Future<List<MVideo>> getVideoList(MSource source, String url) async {
|
||||
final res = await http('GET', json.encode({"url": url}));
|
||||
|
||||
final servers =
|
||||
MBridge.xpath(res, '//*[@id="nav-tabContent"]/div/iframe/@src');
|
||||
xpath(res, '//*[@id="nav-tabContent"]/div/iframe/@src');
|
||||
List<MVideo> videos = [];
|
||||
for (var url in servers) {
|
||||
final datasServer = {
|
||||
@@ -171,20 +171,20 @@ class OtakuFr extends MSourceProvider {
|
||||
"headers": {"X-Requested-With": "XMLHttpRequest"}
|
||||
};
|
||||
|
||||
final resServer = await MBridge.http('GET', json.encode(datasServer));
|
||||
final resServer = await http('GET', json.encode(datasServer));
|
||||
final serverUrl =
|
||||
fixUrl(MBridge.regExp(resServer, r"data-url='([^']+)'", '', 1, 1));
|
||||
fixUrl(regExp(resServer, r"data-url='([^']+)'", '', 1, 1));
|
||||
List<MVideo> a = [];
|
||||
if (serverUrl.contains("https://streamwish")) {
|
||||
a = await MBridge.streamWishExtractor(serverUrl, "StreamWish");
|
||||
a = await streamWishExtractor(serverUrl, "StreamWish");
|
||||
} else if (serverUrl.contains("sibnet")) {
|
||||
a = await MBridge.sibnetExtractor(serverUrl);
|
||||
a = await sibnetExtractor(serverUrl);
|
||||
} else if (serverUrl.contains("https://doo")) {
|
||||
a = await MBridge.doodExtractor(serverUrl);
|
||||
a = await doodExtractor(serverUrl);
|
||||
} else if (serverUrl.contains("https://voe.sx")) {
|
||||
a = await MBridge.voeExtractor(serverUrl, null);
|
||||
a = await voeExtractor(serverUrl, null);
|
||||
} else if (serverUrl.contains("https://ok.ru")) {
|
||||
a = await MBridge.okruExtractor(serverUrl);
|
||||
a = await okruExtractor(serverUrl);
|
||||
}
|
||||
videos.addAll(a);
|
||||
}
|
||||
@@ -193,11 +193,11 @@ class OtakuFr extends MSourceProvider {
|
||||
}
|
||||
|
||||
String fixUrl(String url) {
|
||||
return MBridge.regExp(url, r"^(?:(?:https?:)?//|www\.)", 'https://', 0, 0);
|
||||
return regExp(url, r"^(?:(?:https?:)?//|www\.)", 'https://', 0, 0);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<String>> getPageList(MSource sourceInfo, String url) async {
|
||||
Future<List<String>> getPageList(MSource source, String url) async {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user