mirror of
https://github.com/kodjodevf/mangayomi-extensions.git
synced 2026-02-14 10:51:17 +00:00
WIP
This commit is contained in:
@@ -1,101 +1,88 @@
|
|||||||
import 'package:mangayomi/bridge_lib.dart';
|
import 'package:mangayomi/bridge_lib.dart';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
class ZoroTheme extends MSourceProvider {
|
class ZoroTheme extends MProvider {
|
||||||
ZoroTheme();
|
ZoroTheme();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> getPopular(MSource sourceInfo, int page) async {
|
Future<MPages> getPopular(MSource source, int page) async {
|
||||||
final data = {"url": "${sourceInfo.baseUrl}/most-popular?page=$page"};
|
final data = {"url": "${source.baseUrl}/most-popular?page=$page"};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
|
|
||||||
return animeElementM(res);
|
return animeElementM(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> getLatestUpdates(MSource sourceInfo, int page) async {
|
Future<MPages> getLatestUpdates(MSource source, int page) async {
|
||||||
final data = {"url": "${sourceInfo.baseUrl}/recently-updated?page=$page"};
|
final data = {"url": "${source.baseUrl}/recently-updated?page=$page"};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
|
|
||||||
return animeElementM(res);
|
return animeElementM(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> search(MSource sourceInfo, String query, int page) async {
|
Future<MPages> search(MSource source, String query, int page) async {
|
||||||
final data = {
|
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);
|
return animeElementM(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MManga> getDetail(MSource sourceInfo, String url) async {
|
Future<MManga> getDetail(MSource source, String url) async {
|
||||||
final statusList = [
|
final statusList = [
|
||||||
{
|
{
|
||||||
"Currently Airing": 0,
|
"Currently Airing": 0,
|
||||||
"Finished Airing": 1,
|
"Finished Airing": 1,
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
final data = {"url": "${sourceInfo.baseUrl}$url"};
|
final data = {"url": "${source.baseUrl}$url"};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
MManga anime = MManga();
|
MManga anime = MManga();
|
||||||
final status = MBridge.xpath(res,
|
final status = xpath(res,
|
||||||
'//*[@class="anisc-info"]/div[contains(text(),"Status:")]/span[2]/text()')
|
'//*[@class="anisc-info"]/div[contains(text(),"Status:")]/span[2]/text()')
|
||||||
.first;
|
.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()')
|
'//*[@class="anisc-info"]/div[contains(text(),"Studios:")]/span/text()')
|
||||||
.first
|
.first
|
||||||
.replaceAll("Studios:", "");
|
.replaceAll("Studios:", "");
|
||||||
final aired = MBridge.xpath(res,
|
anime.description = 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,
|
|
||||||
'//*[@class="anisc-info"]/div[contains(text(),"Overview:")]/text()')
|
'//*[@class="anisc-info"]/div[contains(text(),"Overview:")]/text()')
|
||||||
.first
|
.first
|
||||||
.replaceAll("Overview:", "");
|
.replaceAll("Overview:", "");
|
||||||
String description =
|
final genre = xpath(res,
|
||||||
"$overview\n\n$japanese\n$synonyms\n$aired\n$premiered";
|
|
||||||
anime.description = description;
|
|
||||||
final genre = MBridge.xpath(res,
|
|
||||||
'//*[@class="anisc-info"]/div[contains(text(),"Genres:")]/a/text()');
|
'//*[@class="anisc-info"]/div[contains(text(),"Genres:")]/a/text()');
|
||||||
|
|
||||||
anime.genre = genre;
|
anime.genre = genre;
|
||||||
final id = MBridge.substringAfterLast(anime.link, '-');
|
final id = substringAfterLast(url, '-');
|
||||||
|
|
||||||
final urlEp =
|
final urlEp =
|
||||||
"${anime.baseUrl}/ajax${ajaxRoute('${anime.baseUrl}')}/episode/list/$id";
|
"${source.baseUrl}/ajax${ajaxRoute('${source.baseUrl}')}/episode/list/$id";
|
||||||
|
|
||||||
final dataEp = {
|
final dataEp = {
|
||||||
"url": urlEp,
|
"url": urlEp,
|
||||||
"headers": {"referer": url}
|
"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 html = json.decode(resEp)["html"];
|
||||||
|
|
||||||
final epUrls = MBridge.querySelectorAll(html,
|
final epUrls = querySelectorAll(html,
|
||||||
selector: "a.ep-item",
|
selector: "a.ep-item",
|
||||||
typeElement: 3,
|
typeElement: 3,
|
||||||
attributes: "href",
|
attributes: "href",
|
||||||
typeRegExp: 0);
|
typeRegExp: 0);
|
||||||
final numbers = MBridge.querySelectorAll(html,
|
final numbers = querySelectorAll(html,
|
||||||
selector: "a.ep-item",
|
selector: "a.ep-item",
|
||||||
typeElement: 3,
|
typeElement: 3,
|
||||||
attributes: "data-number",
|
attributes: "data-number",
|
||||||
typeRegExp: 0);
|
typeRegExp: 0);
|
||||||
|
|
||||||
final titles = MBridge.querySelectorAll(html,
|
final titles = querySelectorAll(html,
|
||||||
selector: "a.ep-item",
|
selector: "a.ep-item",
|
||||||
typeElement: 3,
|
typeElement: 3,
|
||||||
attributes: "title",
|
attributes: "title",
|
||||||
@@ -121,30 +108,30 @@ class ZoroTheme extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<MVideo>> getVideoList(MSource sourceInfo, String url) async {
|
Future<List<MVideo>> getVideoList(MSource source, String url) async {
|
||||||
final id = MBridge.substringAfterLast(url, '?ep=');
|
final id = substringAfterLast(url, '?ep=');
|
||||||
|
|
||||||
final datas = {
|
final datas = {
|
||||||
"url":
|
"url":
|
||||||
"${sourceInfo.baseUrl}/ajax${ajaxRoute('${sourceInfo.baseUrl}')}/episode/servers?episodeId=$id",
|
"${source.baseUrl}/ajax${ajaxRoute('${source.baseUrl}')}/episode/servers?episodeId=$id",
|
||||||
"headers": {"referer": "${sourceInfo.baseUrl}/$url"}
|
"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 html = json.decode(res)["html"];
|
||||||
|
|
||||||
final names = MBridge.querySelectorAll(html,
|
final names = querySelectorAll(html,
|
||||||
selector: "div.server-item",
|
selector: "div.server-item",
|
||||||
typeElement: 0,
|
typeElement: 0,
|
||||||
attributes: "",
|
attributes: "",
|
||||||
typeRegExp: 0);
|
typeRegExp: 0);
|
||||||
|
|
||||||
final ids = MBridge.querySelectorAll(html,
|
final ids = querySelectorAll(html,
|
||||||
selector: "div.server-item",
|
selector: "div.server-item",
|
||||||
typeElement: 3,
|
typeElement: 3,
|
||||||
attributes: "data-id",
|
attributes: "data-id",
|
||||||
typeRegExp: 0);
|
typeRegExp: 0);
|
||||||
|
|
||||||
final subDubs = MBridge.querySelectorAll(html,
|
final subDubs = querySelectorAll(html,
|
||||||
selector: "div.server-item",
|
selector: "div.server-item",
|
||||||
typeElement: 3,
|
typeElement: 3,
|
||||||
attributes: "data-type",
|
attributes: "data-type",
|
||||||
@@ -158,21 +145,21 @@ class ZoroTheme extends MSourceProvider {
|
|||||||
final subDub = subDubs[i];
|
final subDub = subDubs[i];
|
||||||
final datasE = {
|
final datasE = {
|
||||||
"url":
|
"url":
|
||||||
"${sourceInfo.baseUrl}/ajax${ajaxRoute('${sourceInfo.baseUrl}')}/episode/sources?id=$id",
|
"${source.baseUrl}/ajax${ajaxRoute('${source.baseUrl}')}/episode/sources?id=$id",
|
||||||
"headers": {"referer": "${sourceInfo.baseUrl}/$url"}
|
"headers": {"referer": "${source.baseUrl}/$url"}
|
||||||
};
|
};
|
||||||
|
|
||||||
final resE = await MBridge.http('GET', json.encode(datasE));
|
final resE = await http('GET', json.encode(datasE));
|
||||||
String epUrl = MBridge.substringBefore(
|
String epUrl = substringBefore(
|
||||||
MBridge.substringAfter(resE, "\"link\":\""), "\"");
|
substringAfter(resE, "\"link\":\""), "\"");
|
||||||
print(epUrl);
|
print(epUrl);
|
||||||
List<MVideo> a = [];
|
List<MVideo> a = [];
|
||||||
if (name.contains("Vidstreaming")) {
|
if (name.contains("Vidstreaming")) {
|
||||||
a = await MBridge.rapidCloudExtractor(epUrl, "Vidstreaming - $subDub");
|
a = await rapidCloudExtractor(epUrl, "Vidstreaming - $subDub");
|
||||||
} else if (name.contains("Vidcloud")) {
|
} else if (name.contains("Vidcloud")) {
|
||||||
a = await MBridge.rapidCloudExtractor(epUrl, "Vidcloud - $subDub");
|
a = await rapidCloudExtractor(epUrl, "Vidcloud - $subDub");
|
||||||
} else if (name.contains("StreamTape")) {
|
} else if (name.contains("StreamTape")) {
|
||||||
a = await MBridge.streamTapeExtractor(epUrl, "StreamTape - $subDub");
|
a = await streamTapeExtractor(epUrl, "StreamTape - $subDub");
|
||||||
}
|
}
|
||||||
videos.addAll(a);
|
videos.addAll(a);
|
||||||
}
|
}
|
||||||
@@ -181,22 +168,21 @@ class ZoroTheme extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<String>> getPageList(MSource sourceInfo, String url) async {
|
Future<List<String>> getPageList(MSource source, String url) async {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
MPages animeElementM(String res) {
|
MPages animeElementM(String res) {
|
||||||
List<MManga> animeList = [];
|
List<MManga> animeList = [];
|
||||||
|
|
||||||
final urls = MBridge.xpath(
|
final urls = xpath(
|
||||||
res, '//*[@class^="flw-item"]/div[@class="film-detail"]/h3/a/@href');
|
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');
|
'//*[@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');
|
res, '//*[@class^="flw-item"]/div[@class="film-poster"]/img/@data-src');
|
||||||
|
|
||||||
for (var i = 0; i < names.length; i++) {
|
for (var i = 0; i < names.length; i++) {
|
||||||
MManga anime = MManga();
|
MManga anime = MManga();
|
||||||
anime.name = names[i];
|
anime.name = names[i];
|
||||||
@@ -204,7 +190,7 @@ class ZoroTheme extends MSourceProvider {
|
|||||||
anime.link = urls[i];
|
anime.link = urls[i];
|
||||||
animeList.add(anime);
|
animeList.add(anime);
|
||||||
}
|
}
|
||||||
final nextPage = MBridge.xpath(
|
final nextPage = xpath(
|
||||||
res, '//li[@class="page-item"]/a[@title="Next"]/@href', "");
|
res, '//li[@class="page-item"]/a[@title="Next"]/@href', "");
|
||||||
return MPages(animeList, !nextPage.isEmpty);
|
return MPages(animeList, !nextPage.isEmpty);
|
||||||
}
|
}
|
||||||
@@ -220,3 +206,4 @@ class ZoroTheme extends MSourceProvider {
|
|||||||
ZoroTheme main() {
|
ZoroTheme main() {
|
||||||
return ZoroTheme();
|
return ZoroTheme();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
import 'package:mangayomi/bridge_lib.dart';
|
import 'package:mangayomi/bridge_lib.dart';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
class OkAnime extends MSourceProvider {
|
class OkAnime extends MProvider {
|
||||||
OkAnime();
|
OkAnime();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> getPopular(MSource sourceInfo, int page) async {
|
Future<MPages> getPopular(MSource source, int page) async {
|
||||||
final data = {"url": sourceInfo.baseUrl};
|
final data = {"url": source.baseUrl};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
|
|
||||||
List<MManga> animeList = [];
|
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');
|
'//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()');
|
'//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');
|
'//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++) {
|
for (var i = 0; i < names.length; i++) {
|
||||||
@@ -28,16 +28,16 @@ class OkAnime extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> getLatestUpdates(MSource sourceInfo, int page) async {
|
Future<MPages> getLatestUpdates(MSource source, int page) async {
|
||||||
final data = {"url": "${sourceInfo.baseUrl}/espisode-list?page=$page"};
|
final data = {"url": "${source.baseUrl}/espisode-list?page=$page"};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
|
|
||||||
List<MManga> animeList = [];
|
List<MManga> animeList = [];
|
||||||
final urls = MBridge.xpath(res,
|
final urls = xpath(res,
|
||||||
'//*[contains(@class,"anime-card")]/div[@class="anime-title")]/h4/a/@href');
|
'//*[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()');
|
'//*[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');
|
'//*[contains(@class,"anime-card")]/div[@class="episode-image")]/img/@src');
|
||||||
|
|
||||||
for (var i = 0; i < names.length; i++) {
|
for (var i = 0; i < names.length; i++) {
|
||||||
@@ -48,25 +48,25 @@ class OkAnime extends MSourceProvider {
|
|||||||
animeList.add(anime);
|
animeList.add(anime);
|
||||||
}
|
}
|
||||||
final nextPage =
|
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);
|
return MPages(animeList, nextPage.isNotEmpty);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> search(MSource sourceInfo, String query, int page) async {
|
Future<MPages> search(MSource source, String query, int page) async {
|
||||||
String url = "${sourceInfo.baseUrl}/search/?s=$query";
|
String url = "${source.baseUrl}/search/?s=$query";
|
||||||
if (page > 1) {
|
if (page > 1) {
|
||||||
url += "&page=$page";
|
url += "&page=$page";
|
||||||
}
|
}
|
||||||
final data = {"url": url};
|
final data = {"url": url};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
|
|
||||||
List<MManga> animeList = [];
|
List<MManga> animeList = [];
|
||||||
final urls = MBridge.xpath(res,
|
final urls = xpath(res,
|
||||||
'//*[contains(@class,"anime-card")]/div[@class="anime-title")]/h4/a/@href');
|
'//*[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()');
|
'//*[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');
|
'//*[contains(@class,"anime-card")]/div[@class="anime-image")]/img/@src');
|
||||||
|
|
||||||
for (var i = 0; i < names.length; i++) {
|
for (var i = 0; i < names.length; i++) {
|
||||||
@@ -77,33 +77,33 @@ class OkAnime extends MSourceProvider {
|
|||||||
animeList.add(anime);
|
animeList.add(anime);
|
||||||
}
|
}
|
||||||
final nextPage =
|
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);
|
return MPages(animeList, nextPage.isNotEmpty);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MManga> getDetail(MSource sourceInfo, String url) async {
|
Future<MManga> getDetail(MSource source, String url) async {
|
||||||
final statusList = [
|
final statusList = [
|
||||||
{"يعرض الان": 0, "مكتمل": 1}
|
{"يعرض الان": 0, "مكتمل": 1}
|
||||||
];
|
];
|
||||||
final data = {"url": url};
|
final data = {"url": url};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
MManga anime = MManga();
|
MManga anime = MManga();
|
||||||
final status = MBridge.xpath(res,
|
final status = xpath(res,
|
||||||
'//*[@class="full-list-info" and contains(text(),"حالة الأنمي")]/small/a/text()');
|
'//*[@class="full-list-info" and contains(text(),"حالة الأنمي")]/small/a/text()');
|
||||||
if (status.isNotEmpty) {
|
if (status.isNotEmpty) {
|
||||||
anime.status = MBridge.parseStatus(status.first, statusList);
|
anime.status = parseStatus(status.first, statusList);
|
||||||
}
|
}
|
||||||
anime.description =
|
anime.description =
|
||||||
MBridge.xpath(res, '//*[@class="review-content"]/text()').first;
|
xpath(res, '//*[@class="review-content"]/text()').first;
|
||||||
|
|
||||||
anime.genre =
|
anime.genre =
|
||||||
MBridge.xpath(res, '//*[@class="review-author-info"]/a/text()');
|
xpath(res, '//*[@class="review-author-info"]/a/text()');
|
||||||
final epUrls = MBridge.xpath(res,
|
final epUrls = xpath(res,
|
||||||
'//*[contains(@class,"anime-card")]/div[@class="anime-title")]/h5/a/@href')
|
'//*[contains(@class,"anime-card")]/div[@class="anime-title")]/h5/a/@href')
|
||||||
.reversed
|
.reversed
|
||||||
.toList();
|
.toList();
|
||||||
final names = MBridge.xpath(res,
|
final names = xpath(res,
|
||||||
'//*[contains(@class,"anime-card")]/div[@class="anime-title")]/h5/a/text()')
|
'//*[contains(@class,"anime-card")]/div[@class="anime-title")]/h5/a/text()')
|
||||||
.reversed
|
.reversed
|
||||||
.toList();
|
.toList();
|
||||||
@@ -121,12 +121,12 @@ class OkAnime extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<MVideo>> getVideoList(MSource sourceInfo, String url) async {
|
Future<List<MVideo>> getVideoList(MSource source, String url) async {
|
||||||
final res = await MBridge.http('GET', json.encode({"url": url}));
|
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 =
|
final qualities =
|
||||||
MBridge.xpath(res, '//*[@id="streamlinks"]/a/span/text()');
|
xpath(res, '//*[@id="streamlinks"]/a/span/text()');
|
||||||
|
|
||||||
List<MVideo> videos = [];
|
List<MVideo> videos = [];
|
||||||
for (var i = 0; i < urls.length; i++) {
|
for (var i = 0; i < urls.length; i++) {
|
||||||
@@ -135,15 +135,15 @@ class OkAnime extends MSourceProvider {
|
|||||||
List<MVideo> a = [];
|
List<MVideo> a = [];
|
||||||
|
|
||||||
if (url.contains("https://doo")) {
|
if (url.contains("https://doo")) {
|
||||||
a = await MBridge.doodExtractor(url, "DoodStream - $quality");
|
a = await doodExtractor(url, "DoodStream - $quality");
|
||||||
} else if (url.contains("mp4upload")) {
|
} else if (url.contains("mp4upload")) {
|
||||||
a = await MBridge.mp4UploadExtractor(url, null, "", "");
|
a = await mp4UploadExtractor(url, null, "", "");
|
||||||
} else if (url.contains("ok.ru")) {
|
} else if (url.contains("ok.ru")) {
|
||||||
a = await MBridge.okruExtractor(url);
|
a = await okruExtractor(url);
|
||||||
} else if (url.contains("voe.sx")) {
|
} else if (url.contains("voe.sx")) {
|
||||||
a = await MBridge.voeExtractor(url, "VoeSX $quality");
|
a = await voeExtractor(url, "VoeSX $quality");
|
||||||
} else if (containsVidBom(url)) {
|
} else if (containsVidBom(url)) {
|
||||||
a = await MBridge.vidBomExtractor(url);
|
a = await vidBomExtractor(url);
|
||||||
}
|
}
|
||||||
videos.addAll(a);
|
videos.addAll(a);
|
||||||
}
|
}
|
||||||
@@ -174,7 +174,7 @@ class OkAnime extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<String>> getPageList(MSource sourceInfo, String url) async {
|
Future<List<String>> getPageList(MSource source, String url) async {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
import 'package:mangayomi/bridge_lib.dart';
|
import 'package:mangayomi/bridge_lib.dart';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
class GogoAnime extends MSourceProvider {
|
class GogoAnime extends MProvider {
|
||||||
GogoAnime();
|
GogoAnime();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> getPopular(MSource sourceInfo, int page) async {
|
Future<MPages> getPopular(MSource source, int page) async {
|
||||||
final data = {"url": "${sourceInfo.baseUrl}/popular.html?page=$page"};
|
final data = {"url": "${source.baseUrl}/popular.html?page=$page"};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
|
|
||||||
List<MManga> animeList = [];
|
List<MManga> animeList = [];
|
||||||
final urls = MBridge.xpath(res, '//*[@class="img"]/a/@href');
|
final urls = xpath(res, '//*[@class="img"]/a/@href');
|
||||||
final names = MBridge.xpath(res, '//*[@class="img"]/a/@title');
|
final names = xpath(res, '//*[@class="img"]/a/@title');
|
||||||
final images = MBridge.xpath(res, '//*[@class="img"]/a/img/@src');
|
final images = xpath(res, '//*[@class="img"]/a/img/@src');
|
||||||
|
|
||||||
for (var i = 0; i < names.length; i++) {
|
for (var i = 0; i < names.length; i++) {
|
||||||
MManga anime = MManga();
|
MManga anime = MManga();
|
||||||
@@ -26,20 +26,20 @@ class GogoAnime extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> getLatestUpdates(MSource sourceInfo, int page) async {
|
Future<MPages> getLatestUpdates(MSource source, int page) async {
|
||||||
final data = {
|
final data = {
|
||||||
"url":
|
"url":
|
||||||
"https://ajax.gogo-load.com/ajax/page-recent-release-ongoing.html?page=$page&type=1"
|
"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 = [];
|
List<MManga> animeList = [];
|
||||||
final urls = MBridge.xpath(
|
final urls = xpath(
|
||||||
res, '//*[@class="added_series_body popular"]/ul/li/a[1]/@href');
|
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');
|
res, '//*[//*[@class="added_series_body popular"]/ul/li/a[1]/@title');
|
||||||
List<String> images = [];
|
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');
|
'//*[//*[@class="added_series_body popular"]/ul/li/a/div[@class="thumbnail-popular"]/@style');
|
||||||
for (var url in imagess) {
|
for (var url in imagess) {
|
||||||
images.add(url.replaceAll("background: url('", "").replaceAll("');", ""));
|
images.add(url.replaceAll("background: url('", "").replaceAll("');", ""));
|
||||||
@@ -57,16 +57,16 @@ class GogoAnime extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> search(MSource sourceInfo, String query, int page) async {
|
Future<MPages> search(MSource source, String query, int page) async {
|
||||||
final data = {
|
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 = [];
|
List<MManga> animeList = [];
|
||||||
final urls = MBridge.xpath(res, '//*[@class="img"]/a/@href');
|
final urls = xpath(res, '//*[@class="img"]/a/@href');
|
||||||
final names = MBridge.xpath(res, '//*[@class="img"]/a/@title');
|
final names = xpath(res, '//*[@class="img"]/a/@title');
|
||||||
final images = MBridge.xpath(res, '//*[@class="img"]/a/img/@src');
|
final images = xpath(res, '//*[@class="img"]/a/img/@src');
|
||||||
|
|
||||||
for (var i = 0; i < names.length; i++) {
|
for (var i = 0; i < names.length; i++) {
|
||||||
MManga anime = MManga();
|
MManga anime = MManga();
|
||||||
@@ -80,45 +80,45 @@ class GogoAnime extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MManga> getDetail(MSource sourceInfo, String url) async {
|
Future<MManga> getDetail(MSource source, String url) async {
|
||||||
final statusList = [
|
final statusList = [
|
||||||
{
|
{
|
||||||
"Ongoing": 0,
|
"Ongoing": 0,
|
||||||
"Completed": 1,
|
"Completed": 1,
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
final data = {"url": "${sourceInfo.baseUrl}$url"};
|
final data = {"url": "${source.baseUrl}$url"};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
MManga anime = MManga();
|
MManga anime = MManga();
|
||||||
final status = MBridge.xpath(
|
final status = xpath(
|
||||||
res, '//*[@class="anime_info_body_bg"]/p[@class="type"][5]/text()')
|
res, '//*[@class="anime_info_body_bg"]/p[@class="type"][5]/text()')
|
||||||
.first
|
.first
|
||||||
.replaceAll("Status: ", "");
|
.replaceAll("Status: ", "");
|
||||||
anime.description = MBridge.xpath(
|
anime.description = xpath(
|
||||||
res, '//*[@class="anime_info_body_bg"]/p[@class="type"][2]/text()')
|
res, '//*[@class="anime_info_body_bg"]/p[@class="type"][2]/text()')
|
||||||
.first
|
.first
|
||||||
.replaceAll("Plot Summary: ", "");
|
.replaceAll("Plot Summary: ", "");
|
||||||
anime.status = MBridge.parseStatus(status, statusList);
|
anime.status = parseStatus(status, statusList);
|
||||||
anime.genre = MBridge.xpath(
|
anime.genre = xpath(
|
||||||
res, '//*[@class="anime_info_body_bg"]/p[@class="type"][3]/text()')
|
res, '//*[@class="anime_info_body_bg"]/p[@class="type"][3]/text()')
|
||||||
.first
|
.first
|
||||||
.replaceAll("Genre: ", "")
|
.replaceAll("Genre: ", "")
|
||||||
.split(",");
|
.split(",");
|
||||||
|
|
||||||
final id = MBridge.xpath(res, '//*[@id="movie_id"]/@value').first;
|
final id = xpath(res, '//*[@id="movie_id"]/@value').first;
|
||||||
final urlEp =
|
final urlEp =
|
||||||
"https://ajax.gogo-load.com/ajax/load-list-episode?ep_start=0&ep_end=4000&id=$id";
|
"https://ajax.gogo-load.com/ajax/load-list-episode?ep_start=0&ep_end=4000&id=$id";
|
||||||
final dataEp = {"url": urlEp};
|
final dataEp = {"url": urlEp};
|
||||||
final resEp = await MBridge.http('GET', json.encode(dataEp));
|
final resEp = await http('GET', json.encode(dataEp));
|
||||||
|
|
||||||
final epUrls =
|
final epUrls =
|
||||||
MBridge.xpath(resEp, '//*[@id="episode_related"]/li/a/@href');
|
xpath(resEp, '//*[@id="episode_related"]/li/a/@href');
|
||||||
final names = MBridge.xpath(
|
final names = xpath(
|
||||||
resEp, '//*[@id="episode_related"]/li/a/div[@class="name"]/text()');
|
resEp, '//*[@id="episode_related"]/li/a/div[@class="name"]/text()');
|
||||||
List<String> episodes = [];
|
List<String> episodes = [];
|
||||||
|
|
||||||
for (var a in names) {
|
for (var a in names) {
|
||||||
episodes.add("Episode ${MBridge.substringAfterLast(a, ' ')}");
|
episodes.add("Episode ${substringAfterLast(a, ' ')}");
|
||||||
}
|
}
|
||||||
List<MChapter>? episodesList = [];
|
List<MChapter>? episodesList = [];
|
||||||
for (var i = 0; i < episodes.length; i++) {
|
for (var i = 0; i < episodes.length; i++) {
|
||||||
@@ -133,27 +133,27 @@ class GogoAnime extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<MVideo>> getVideoList(MSource sourceInfo, String url) async {
|
Future<List<MVideo>> getVideoList(MSource source, String url) async {
|
||||||
final datas = {"url": "${sourceInfo.baseUrl}$url"};
|
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 =
|
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 =
|
final classNames =
|
||||||
MBridge.xpath(res, '//*[@class="anime_muti_link"]/ul/li/@class');
|
xpath(res, '//*[@class="anime_muti_link"]/ul/li/@class');
|
||||||
List<MVideo> videos = [];
|
List<MVideo> videos = [];
|
||||||
for (var i = 0; i < classNames.length; i++) {
|
for (var i = 0; i < classNames.length; i++) {
|
||||||
final name = classNames[i];
|
final name = classNames[i];
|
||||||
final url = serverUrls[i];
|
final url = serverUrls[i];
|
||||||
List<MVideo> a = [];
|
List<MVideo> a = [];
|
||||||
if (name.contains("anime")) {
|
if (name.contains("anime")) {
|
||||||
a = await MBridge.gogoCdnExtractor(url);
|
a = await gogoCdnExtractor(url);
|
||||||
} else if (name.contains("vidcdn")) {
|
} else if (name.contains("vidcdn")) {
|
||||||
a = await MBridge.gogoCdnExtractor(url);
|
a = await gogoCdnExtractor(url);
|
||||||
} else if (name.contains("doodstream")) {
|
} else if (name.contains("doodstream")) {
|
||||||
a = await MBridge.doodExtractor(url);
|
a = await doodExtractor(url);
|
||||||
} else if (name.contains("mp4upload")) {
|
} else if (name.contains("mp4upload")) {
|
||||||
a = await MBridge.mp4UploadExtractor(url, null, "", "");
|
a = await mp4UploadExtractor(url, null, "", "");
|
||||||
} else if (name.contains("streamsb")) {}
|
} else if (name.contains("streamsb")) {}
|
||||||
videos.addAll(a);
|
videos.addAll(a);
|
||||||
}
|
}
|
||||||
@@ -162,7 +162,7 @@ class GogoAnime extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<String>> getPageList(MSource sourceInfo, String url) async {
|
Future<List<String>> getPageList(MSource source, String url) async {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
import 'package:mangayomi/bridge_lib.dart';
|
import 'package:mangayomi/bridge_lib.dart';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
class KissKh extends MSourceProvider {
|
class KissKh extends MProvider {
|
||||||
KissKh();
|
KissKh();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> getPopular(MSource sourceInfo, int page) async {
|
Future<MPages> getPopular(MSource source, int page) async {
|
||||||
final data = {
|
final data = {
|
||||||
"url":
|
"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 jsonRes = json.decode(res);
|
||||||
final datas = jsonRes["data"] as List;
|
final datas = jsonRes["data"] as List;
|
||||||
List<MManga> animeList = [];
|
List<MManga> animeList = [];
|
||||||
@@ -20,7 +20,7 @@ class KissKh extends MSourceProvider {
|
|||||||
anime.name = data["title"];
|
anime.name = data["title"];
|
||||||
anime.imageUrl = data["thumbnail"] ?? "";
|
anime.imageUrl = data["thumbnail"] ?? "";
|
||||||
anime.link =
|
anime.link =
|
||||||
"${sourceInfo.baseUrl}/api/DramaList/Drama/${data["id"]}?isq=false";
|
"${source.baseUrl}/api/DramaList/Drama/${data["id"]}?isq=false";
|
||||||
animeList.add(anime);
|
animeList.add(anime);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -30,13 +30,13 @@ class KissKh extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> getLatestUpdates(MSource sourceInfo, int page) async {
|
Future<MPages> getLatestUpdates(MSource source, int page) async {
|
||||||
final data = {
|
final data = {
|
||||||
"url":
|
"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"}
|
"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 jsonRes = json.decode(res);
|
||||||
final datas = jsonRes["data"] as List;
|
final datas = jsonRes["data"] as List;
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ class KissKh extends MSourceProvider {
|
|||||||
anime.name = data["title"];
|
anime.name = data["title"];
|
||||||
anime.imageUrl = data["thumbnail"] ?? "";
|
anime.imageUrl = data["thumbnail"] ?? "";
|
||||||
anime.link =
|
anime.link =
|
||||||
"${sourceInfo.baseUrl}/api/DramaList/Drama/${data["id"]}?isq=false";
|
"${source.baseUrl}/api/DramaList/Drama/${data["id"]}?isq=false";
|
||||||
animeList.add(anime);
|
animeList.add(anime);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,11 +57,11 @@ class KissKh extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> search(MSource sourceInfo, String query, int page) async {
|
Future<MPages> search(MSource source, String query, int page) async {
|
||||||
final data = {
|
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);
|
final jsonRes = json.decode(res);
|
||||||
List<MManga> animeList = [];
|
List<MManga> animeList = [];
|
||||||
for (var data in jsonRes) {
|
for (var data in jsonRes) {
|
||||||
@@ -69,14 +69,14 @@ class KissKh extends MSourceProvider {
|
|||||||
anime.name = data["title"];
|
anime.name = data["title"];
|
||||||
anime.imageUrl = data["thumbnail"] ?? "";
|
anime.imageUrl = data["thumbnail"] ?? "";
|
||||||
anime.link =
|
anime.link =
|
||||||
"${sourceInfo.baseUrl}/api/DramaList/Drama/${data["id"]}?isq=false";
|
"${source.baseUrl}/api/DramaList/Drama/${data["id"]}?isq=false";
|
||||||
animeList.add(anime);
|
animeList.add(anime);
|
||||||
}
|
}
|
||||||
return MPages(animeList, false);
|
return MPages(animeList, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MManga> getDetail(MSource sourceInfo, String url) async {
|
Future<MManga> getDetail(MSource source, String url) async {
|
||||||
final statusList = [
|
final statusList = [
|
||||||
{
|
{
|
||||||
"Ongoing": 0,
|
"Ongoing": 0,
|
||||||
@@ -84,13 +84,13 @@ class KissKh extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
final data = {"url": url};
|
final data = {"url": url};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
MManga anime = MManga();
|
MManga anime = MManga();
|
||||||
final jsonRes = json.decode(res);
|
final jsonRes = json.decode(res);
|
||||||
final status = jsonRes["status"] ?? "";
|
final status = jsonRes["status"] ?? "";
|
||||||
print(status);
|
print(status);
|
||||||
anime.description = jsonRes["description"];
|
anime.description = jsonRes["description"];
|
||||||
anime.status = MBridge.parseStatus(status, statusList);
|
anime.status = parseStatus(status, statusList);
|
||||||
anime.imageUrl = jsonRes["thumbnail"];
|
anime.imageUrl = jsonRes["thumbnail"];
|
||||||
var episodes = jsonRes["episodes"];
|
var episodes = jsonRes["episodes"];
|
||||||
String type = jsonRes["type"];
|
String type = jsonRes["type"];
|
||||||
@@ -113,7 +113,7 @@ class KissKh extends MSourceProvider {
|
|||||||
episode.name = "Episode $number";
|
episode.name = "Episode $number";
|
||||||
}
|
}
|
||||||
episode.url =
|
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);
|
episodesList.add(episode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,16 +122,16 @@ class KissKh extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<MVideo>> getVideoList(MSource sourceInfo, String url) async {
|
Future<List<MVideo>> getVideoList(MSource source, String url) async {
|
||||||
final datas = {"url": url};
|
final datas = {"url": url};
|
||||||
|
|
||||||
final res = await MBridge.http('GET', json.encode(datas));
|
final res = await http('GET', json.encode(datas));
|
||||||
final id = MBridge.substringAfter(
|
final id = substringAfter(
|
||||||
MBridge.substringBefore(url, ".png"), "Episode/");
|
substringBefore(url, ".png"), "Episode/");
|
||||||
final jsonRes = json.decode(res);
|
final jsonRes = json.decode(res);
|
||||||
|
|
||||||
final subRes = await MBridge.http(
|
final subRes = await http(
|
||||||
'GET', json.encode({"url": "${sourceInfo.baseUrl}/api/Sub/$id"}));
|
'GET', json.encode({"url": "${source.baseUrl}/api/Sub/$id"}));
|
||||||
var jsonSubRes = json.decode(subRes);
|
var jsonSubRes = json.decode(subRes);
|
||||||
|
|
||||||
List<MTrack> subtitles = [];
|
List<MTrack> subtitles = [];
|
||||||
@@ -162,7 +162,7 @@ class KissKh extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<String>> getPageList(MSource sourceInfo, String url) async {
|
Future<List<String>> getPageList(MSource source, String url) async {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
import 'package:mangayomi/bridge_lib.dart';
|
import 'package:mangayomi/bridge_lib.dart';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
class AnimesUltra extends MSourceProvider {
|
class AnimesUltra extends MProvider {
|
||||||
AnimesUltra();
|
AnimesUltra();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> getPopular(MSource sourceInfo, int page) async {
|
Future<MPages> getPopular(MSource source, int page) async {
|
||||||
final data = {"url": "${sourceInfo.baseUrl}/"};
|
final data = {"url": "${source.baseUrl}/"};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
|
|
||||||
List<MManga> animeList = [];
|
List<MManga> animeList = [];
|
||||||
final urls = MBridge.xpath(res,
|
final urls = xpath(res,
|
||||||
'//*[contains(@class,"swiper-slide item-qtip")]/div[@class="item"]/a/@href');
|
'//*[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');
|
'//*[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');
|
'//*[contains(@class,"swiper-slide item-qtip")]/div[@class="item"]/a/img/@data-src');
|
||||||
|
|
||||||
for (var i = 0; i < names.length; i++) {
|
for (var i = 0; i < names.length; i++) {
|
||||||
@@ -29,16 +29,16 @@ class AnimesUltra extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> getLatestUpdates(MSource sourceInfo, int page) async {
|
Future<MPages> getLatestUpdates(MSource source, int page) async {
|
||||||
final data = {"url": "${sourceInfo.baseUrl}/"};
|
final data = {"url": "${source.baseUrl}/"};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
|
|
||||||
List<MManga> animeList = [];
|
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');
|
'//*[@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');
|
'//*[@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');
|
'//*[@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++) {
|
for (var i = 0; i < names.length; i++) {
|
||||||
@@ -53,15 +53,15 @@ class AnimesUltra extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@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}/"};
|
final data = {"url": "${source.baseUrl}/"};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
|
|
||||||
List<MManga> animeList = [];
|
List<MManga> animeList = [];
|
||||||
final urls = MBridge.xpath(res, '//*[@class="film-poster"]/a/@href');
|
final urls = xpath(res, '//*[@class="film-poster"]/a/@href');
|
||||||
final names = MBridge.xpath(res, '//*[@class="film-poster"]/a/@title');
|
final names = xpath(res, '//*[@class="film-poster"]/a/@title');
|
||||||
final images =
|
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++) {
|
for (var i = 0; i < names.length; i++) {
|
||||||
MManga anime = MManga();
|
MManga anime = MManga();
|
||||||
@@ -75,7 +75,7 @@ class AnimesUltra extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MManga> getDetail(MSource sourceInfo, String url) async {
|
Future<MManga> getDetail(MSource source, String url) async {
|
||||||
final statusList = [
|
final statusList = [
|
||||||
{
|
{
|
||||||
"En cours": 0,
|
"En cours": 0,
|
||||||
@@ -83,28 +83,28 @@ class AnimesUltra extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
final data = {"url": url};
|
final data = {"url": url};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
MManga anime = MManga();
|
MManga anime = MManga();
|
||||||
anime.description =
|
anime.description =
|
||||||
MBridge.xpath(res, '//*[@class="film-description m-hide"]/text()')
|
xpath(res, '//*[@class="film-description m-hide"]/text()')
|
||||||
.first;
|
.first;
|
||||||
|
|
||||||
final status = MBridge.xpath(res,
|
final status = xpath(res,
|
||||||
'//*[@class="item item-title" and contains(text(),"Status:")]/span[2]/text()')
|
'//*[@class="item item-title" and contains(text(),"Status:")]/span[2]/text()')
|
||||||
.first;
|
.first;
|
||||||
anime.status = MBridge.parseStatus(status, statusList);
|
anime.status = parseStatus(status, statusList);
|
||||||
anime.genre = MBridge.xpath(res,
|
anime.genre = xpath(res,
|
||||||
'//*[@class="item item-list" and contains(text(),"Genres:")]/a/text()');
|
'//*[@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()')
|
'//*[@class="item item-title" and contains(text(),"Studio:")]/span[2]/text()')
|
||||||
.first;
|
.first;
|
||||||
final urlEp = url.replaceAll('.html', '/episode-1.html');
|
final urlEp = url.replaceAll('.html', '/episode-1.html');
|
||||||
final resEpWebview =
|
final resEpWebview =
|
||||||
await MBridge.getHtmlViaWebview(urlEp, '//*[@class="ss-list"]/a/@href');
|
await getHtmlViaWebview(urlEp, '//*[@class="ss-list"]/a/@href');
|
||||||
final epUrls = MBridge.xpath(resEpWebview, '//*[@class="ss-list"]/a/@href')
|
final epUrls = xpath(resEpWebview, '//*[@class="ss-list"]/a/@href')
|
||||||
.reversed
|
.reversed
|
||||||
.toList();
|
.toList();
|
||||||
final names = MBridge.xpath(resEpWebview,
|
final names = xpath(resEpWebview,
|
||||||
'//*[@class="ss-list"]/a/div[@class="ssli-detail"]/div/text()')
|
'//*[@class="ss-list"]/a/div[@class="ssli-detail"]/div/text()')
|
||||||
.reversed
|
.reversed
|
||||||
.toList();
|
.toList();
|
||||||
@@ -122,18 +122,18 @@ class AnimesUltra extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<MVideo>> getVideoList(MSource sourceInfo, String url) async {
|
Future<List<MVideo>> getVideoList(MSource source, String url) async {
|
||||||
final resWebview = await MBridge.getHtmlViaWebview(
|
final resWebview = await getHtmlViaWebview(
|
||||||
url, '//*[@class="ps__-list"]/div/@data-server-id');
|
url, '//*[@class="ps__-list"]/div/@data-server-id');
|
||||||
|
|
||||||
final serverIds = MBridge.xpath(
|
final serverIds = xpath(
|
||||||
resWebview, '//*[@class="ps__-list"]/div/@data-server-id');
|
resWebview, '//*[@class="ps__-list"]/div/@data-server-id');
|
||||||
final serverNames =
|
final serverNames =
|
||||||
MBridge.xpath(resWebview, '//*[@class="ps__-list"]/div/a/text()');
|
xpath(resWebview, '//*[@class="ps__-list"]/div/a/text()');
|
||||||
List<String> serverUrls = [];
|
List<String> serverUrls = [];
|
||||||
for (var id in serverIds) {
|
for (var id in serverIds) {
|
||||||
final serversUrls =
|
final serversUrls =
|
||||||
MBridge.xpath(resWebview, '//*[@id="content_player_${id}"]/text()')
|
xpath(resWebview, '//*[@id="content_player_${id}"]/text()')
|
||||||
.first;
|
.first;
|
||||||
serverUrls.add(serversUrls);
|
serverUrls.add(serversUrls);
|
||||||
}
|
}
|
||||||
@@ -144,15 +144,15 @@ class AnimesUltra extends MSourceProvider {
|
|||||||
|
|
||||||
List<MVideo> a = [];
|
List<MVideo> a = [];
|
||||||
if (name.contains("Sendvid")) {
|
if (name.contains("Sendvid")) {
|
||||||
a = await MBridge.sendVidExtractor(
|
a = await sendVidExtractor(
|
||||||
url.replaceAll("https:////", "https://"),
|
url.replaceAll("https:////", "https://"),
|
||||||
json.encode({"Referer": "${sourceInfo.baseUrl}/"}),
|
json.encode({"Referer": "${source.baseUrl}/"}),
|
||||||
"");
|
"");
|
||||||
} else if (name.contains("Sibnet")) {
|
} else if (name.contains("Sibnet")) {
|
||||||
a = await MBridge.sibnetExtractor(
|
a = await sibnetExtractor(
|
||||||
"https://video.sibnet.ru/shell.php?videoid=$url");
|
"https://video.sibnet.ru/shell.php?videoid=$url");
|
||||||
} else if (name.contains("Mytv")) {
|
} 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);
|
videos.addAll(a);
|
||||||
}
|
}
|
||||||
@@ -161,7 +161,7 @@ class AnimesUltra extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<String>> getPageList(MSource sourceInfo, String url) async {
|
Future<List<String>> getPageList(MSource source, String url) async {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,23 +1,22 @@
|
|||||||
import 'package:mangayomi/bridge_lib.dart';
|
import 'package:mangayomi/bridge_lib.dart';
|
||||||
import 'package:mangayomi/utils.dart';
|
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
class FrAnime extends MSourceProvider {
|
class FrAnime extends MProvider {
|
||||||
FrAnime();
|
FrAnime();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> getPopular(MSource sourceInfo, int page) async {
|
Future<MPages> getPopular(MSource source, int page) async {
|
||||||
final data = {
|
final data = {
|
||||||
"url": "https://api.franime.fr/api/animes/",
|
"url": "https://api.franime.fr/api/animes/",
|
||||||
"headers": {"Referer": "https://franime.fr/"}
|
"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);
|
return animeResList(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> getLatestUpdates(MSource sourceInfo, int page) async {
|
Future<MPages> getLatestUpdates(MSource source, int page) async {
|
||||||
final res = await dataBase();
|
final res = await dataBase();
|
||||||
|
|
||||||
List list = json.decode(res);
|
List list = json.decode(res);
|
||||||
@@ -25,23 +24,20 @@ class FrAnime extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@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();
|
final res = await dataBase();
|
||||||
|
|
||||||
return animeSeachFetch(res, query);
|
return animeSeachFetch(res, query);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MManga> getDetail(MSource sourceInfo, String url) async {
|
Future<MManga> getDetail(MSource source, String url) async {
|
||||||
MManga anime = MManga();
|
MManga anime = MManga();
|
||||||
String language = "vo".toString();
|
String language = "vo".toString();
|
||||||
if (url.contains("lang=")) {
|
if (url.contains("lang=")) {
|
||||||
language =
|
language = substringBefore(substringAfter(url, "lang="), "&");
|
||||||
Substring(url).substringAfter("lang=").substringBefore("&").text;
|
|
||||||
print(language);
|
|
||||||
}
|
}
|
||||||
String stem =
|
String stem = substringBefore(substringAfterLast(url, "/"), "?");
|
||||||
Substring(url).substringAfterLast("/").substringBefore("?").text;
|
|
||||||
final res = await dataBase();
|
final res = await dataBase();
|
||||||
|
|
||||||
final animeByTitleOJson = databaseAnimeByTitleO(res, stem);
|
final animeByTitleOJson = databaseAnimeByTitleO(res, stem);
|
||||||
@@ -50,8 +46,8 @@ class FrAnime extends MSourceProvider {
|
|||||||
var seasonsJson = seasons.first;
|
var seasonsJson = seasons.first;
|
||||||
|
|
||||||
if (url.contains("s=")) {
|
if (url.contains("s=")) {
|
||||||
int seasonNumber = int.parse(
|
int seasonNumber =
|
||||||
Substring(url).substringAfter("s=").substringBefore("&").text);
|
int.parse(substringBefore(substringAfter(url, "s="), "&"));
|
||||||
seasonsJson = seasons[seasonNumber - 1];
|
seasonsJson = seasons[seasonNumber - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,21 +80,18 @@ class FrAnime extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
anime.chapters = episodesList;
|
anime.chapters = episodesList.reversed.toList();
|
||||||
return anime;
|
return anime;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<MVideo>> getVideoList(MSource sourceInfo, String url) async {
|
Future<List<MVideo>> getVideoList(MSource source, String url) async {
|
||||||
String language = "vo".toString();
|
String language = "vo".toString();
|
||||||
String videoBaseUrl = "https://api.franime.fr/api/anime".toString();
|
String videoBaseUrl = "https://api.franime.fr/api/anime".toString();
|
||||||
if (url.contains("lang=")) {
|
if (url.contains("lang=")) {
|
||||||
language =
|
language = substringBefore(substringAfter(url, "lang="), "&");
|
||||||
Substring(url).substringAfter("lang=").substringBefore("&").text;
|
|
||||||
print(language);
|
|
||||||
}
|
}
|
||||||
String stem =
|
String stem = substringBefore(substringAfterLast(url, "/"), "?");
|
||||||
Substring(url).substringAfterLast("/").substringBefore("?").text;
|
|
||||||
final res = await dataBase();
|
final res = await dataBase();
|
||||||
|
|
||||||
final animeByTitleOJson = databaseAnimeByTitleO(res, stem);
|
final animeByTitleOJson = databaseAnimeByTitleO(res, stem);
|
||||||
@@ -110,8 +103,8 @@ class FrAnime extends MSourceProvider {
|
|||||||
videoBaseUrl += "/$animeId/";
|
videoBaseUrl += "/$animeId/";
|
||||||
|
|
||||||
if (url.contains("s=")) {
|
if (url.contains("s=")) {
|
||||||
int seasonNumber = int.parse(
|
int seasonNumber =
|
||||||
Substring(url).substringAfter("s=").substringBefore("&").text);
|
int.parse(substringBefore(substringAfter(url, "s="), "&"));
|
||||||
print(seasonNumber);
|
print(seasonNumber);
|
||||||
videoBaseUrl += "${seasonNumber - 1}/";
|
videoBaseUrl += "${seasonNumber - 1}/";
|
||||||
seasonsJson = seasons[seasonNumber - 1];
|
seasonsJson = seasons[seasonNumber - 1];
|
||||||
@@ -121,7 +114,7 @@ class FrAnime extends MSourceProvider {
|
|||||||
final episodesJson = seasonsJson["episodes"];
|
final episodesJson = seasonsJson["episodes"];
|
||||||
var episode = episodesJson.first;
|
var episode = episodesJson.first;
|
||||||
if (url.contains("ep=")) {
|
if (url.contains("ep=")) {
|
||||||
int episodeNumber = int.parse(Substring(url).substringAfter("ep=").text);
|
int episodeNumber = int.parse(substringAfter(url, "ep="));
|
||||||
print(episodeNumber);
|
print(episodeNumber);
|
||||||
episode = episodesJson[episodeNumber - 1];
|
episode = episodesJson[episodeNumber - 1];
|
||||||
videoBaseUrl += "${episodeNumber - 1}";
|
videoBaseUrl += "${episodeNumber - 1}";
|
||||||
@@ -153,7 +146,7 @@ class FrAnime extends MSourceProvider {
|
|||||||
"url": apiUrl,
|
"url": apiUrl,
|
||||||
"headers": {"Referer": "https://franime.fr/"}
|
"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 = [];
|
List<MVideo> a = [];
|
||||||
if (playerName.contains("vido")) {
|
if (playerName.contains("vido")) {
|
||||||
@@ -162,12 +155,12 @@ class FrAnime extends MSourceProvider {
|
|||||||
..originalUrl = playerUrl
|
..originalUrl = playerUrl
|
||||||
..quality = "FRAnime (Vido)");
|
..quality = "FRAnime (Vido)");
|
||||||
} else if (playerName.contains("myvi")) {
|
} else if (playerName.contains("myvi")) {
|
||||||
a = await MBridge.myTvExtractor(playerUrl);
|
a = await myTvExtractor(playerUrl);
|
||||||
} else if (playerName.contains("sendvid")) {
|
} else if (playerName.contains("sendvid")) {
|
||||||
a = await MBridge.sendVidExtractor(
|
a = await sendVidExtractor(
|
||||||
playerUrl, json.encode({"Referer": "https://franime.fr/"}), "");
|
playerUrl, json.encode({"Referer": "https://franime.fr/"}), "");
|
||||||
} else if (playerName.contains("sibnet")) {
|
} else if (playerName.contains("sibnet")) {
|
||||||
a = await MBridge.sibnetExtractor(playerUrl);
|
a = await sibnetExtractor(playerUrl);
|
||||||
}
|
}
|
||||||
videos.addAll(a);
|
videos.addAll(a);
|
||||||
}
|
}
|
||||||
@@ -176,7 +169,7 @@ class FrAnime extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<String>> getPageList(MSource sourceInfo, String url) async {
|
Future<List<String>> getPageList(MSource source, String url) async {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -206,7 +199,7 @@ class FrAnime extends MSourceProvider {
|
|||||||
final title = animeJson["title"];
|
final title = animeJson["title"];
|
||||||
final genre = animeJson["themes"];
|
final genre = animeJson["themes"];
|
||||||
final description = animeJson["description"];
|
final description = animeJson["description"];
|
||||||
final status = MBridge.parseStatus(animeJson["status"], statusList);
|
final status = parseStatus(animeJson["status"], statusList);
|
||||||
final imageUrl = animeJson["affiche"];
|
final imageUrl = animeJson["affiche"];
|
||||||
bool hasVostfr = vostfrListName.contains(true);
|
bool hasVostfr = vostfrListName.contains(true);
|
||||||
bool hasVf = vfListName.contains(true);
|
bool hasVf = vfListName.contains(true);
|
||||||
@@ -239,7 +232,7 @@ class FrAnime extends MSourceProvider {
|
|||||||
anime.name = seasonTitle;
|
anime.name = seasonTitle;
|
||||||
anime.imageUrl = imageUrl;
|
anime.imageUrl = imageUrl;
|
||||||
anime.link =
|
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);
|
animeList.add(anime);
|
||||||
}
|
}
|
||||||
@@ -257,18 +250,18 @@ class FrAnime extends MSourceProvider {
|
|||||||
for (var animeJson in jsonResList) {
|
for (var animeJson in jsonResList) {
|
||||||
MManga anime = MManga();
|
MManga anime = MManga();
|
||||||
|
|
||||||
final titleO = MBridge.getMapValue(json.encode(animeJson), "titleO");
|
final titleO = getMapValue(json.encode(animeJson), "titleO");
|
||||||
final titleAlt =
|
final titleAlt =
|
||||||
MBridge.getMapValue(json.encode(animeJson), "titles", encode: true);
|
getMapValue(json.encode(animeJson), "titles", encode: true);
|
||||||
final containsEn = MBridge.getMapValue(titleAlt, "en")
|
final containsEn = getMapValue(titleAlt, "en")
|
||||||
.toString()
|
.toString()
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.contains(query.toLowerCase());
|
.contains(query.toLowerCase());
|
||||||
final containsEnJp = MBridge.getMapValue(titleAlt, "en_jp")
|
final containsEnJp = getMapValue(titleAlt, "en_jp")
|
||||||
.toString()
|
.toString()
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.contains(query.toLowerCase());
|
.contains(query.toLowerCase());
|
||||||
final containsJaJp = MBridge.getMapValue(titleAlt, "ja_jp")
|
final containsJaJp = getMapValue(titleAlt, "ja_jp")
|
||||||
.toString()
|
.toString()
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.contains(query.toLowerCase());
|
.contains(query.toLowerCase());
|
||||||
@@ -291,7 +284,7 @@ class FrAnime extends MSourceProvider {
|
|||||||
final title = animeJson["title"];
|
final title = animeJson["title"];
|
||||||
final genre = animeJson["themes"];
|
final genre = animeJson["themes"];
|
||||||
final description = animeJson["description"];
|
final description = animeJson["description"];
|
||||||
final status = MBridge.parseStatus(animeJson["status"], statusList);
|
final status = parseStatus(animeJson["status"], statusList);
|
||||||
final imageUrl = animeJson["affiche"];
|
final imageUrl = animeJson["affiche"];
|
||||||
|
|
||||||
bool hasVostfr = vostfrListName.contains(true);
|
bool hasVostfr = vostfrListName.contains(true);
|
||||||
@@ -325,7 +318,7 @@ class FrAnime extends MSourceProvider {
|
|||||||
anime.name = seasonTitle;
|
anime.name = seasonTitle;
|
||||||
anime.imageUrl = imageUrl;
|
anime.imageUrl = imageUrl;
|
||||||
anime.link =
|
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);
|
animeList.add(anime);
|
||||||
}
|
}
|
||||||
@@ -341,18 +334,18 @@ class FrAnime extends MSourceProvider {
|
|||||||
"headers": {"Referer": "https://franime.fr/"}
|
"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) {
|
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) {
|
for (var data in datas) {
|
||||||
if (MBridge.regExp(MBridge.getMapValue(data, "titleO"), "[^A-Za-z0-9 ]",
|
if (regExp(data["titleO"], "[^A-Za-z0-9 ]", "", 0, 0)
|
||||||
"", 0, 0)
|
|
||||||
.replaceAll(" ", "-")
|
.replaceAll(" ", "-")
|
||||||
.toLowerCase() ==
|
.toLowerCase() ==
|
||||||
"${titleO}") {
|
"${titleO}") {
|
||||||
return data;
|
return json.encode(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
|
|||||||
@@ -1,22 +1,22 @@
|
|||||||
import 'package:mangayomi/bridge_lib.dart';
|
import 'package:mangayomi/bridge_lib.dart';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
class OtakuFr extends MSourceProvider {
|
class OtakuFr extends MProvider {
|
||||||
OtakuFr();
|
OtakuFr();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> getPopular(MSource sourceInfo, int page) async {
|
Future<MPages> getPopular(MSource source, int page) async {
|
||||||
final data = {
|
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 = [];
|
List<MManga> animeList = [];
|
||||||
final urls =
|
final urls =
|
||||||
MBridge.xpath(res, '//*[@class="list"]/article/div/div/figure/a/@href');
|
xpath(res, '//*[@class="list"]/article/div/div/figure/a/@href');
|
||||||
final names = MBridge.xpath(
|
final names = xpath(
|
||||||
res, '//*[@class="list"]/article/div/div/figure/a/img/@title');
|
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');
|
res, '//*[@class="list"]/article/div/div/figure/a/img/@src');
|
||||||
|
|
||||||
for (var i = 0; i < names.length; i++) {
|
for (var i = 0; i < names.length; i++) {
|
||||||
@@ -26,21 +26,21 @@ class OtakuFr extends MSourceProvider {
|
|||||||
anime.link = urls[i];
|
anime.link = urls[i];
|
||||||
animeList.add(anime);
|
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);
|
return MPages(animeList, nextPage.isNotEmpty);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> getLatestUpdates(MSource sourceInfo, int page) async {
|
Future<MPages> getLatestUpdates(MSource source, int page) async {
|
||||||
final data = {"url": "${sourceInfo.baseUrl}/page/$page/"};
|
final data = {"url": "${source.baseUrl}/page/$page/"};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
|
|
||||||
List<MManga> animeList = [];
|
List<MManga> animeList = [];
|
||||||
final urls = MBridge.xpath(res, '//*[@class="episode"]/div/a/@href');
|
final urls = xpath(res, '//*[@class="episode"]/div/a/@href');
|
||||||
final namess = MBridge.xpath(res, '//*[@class="episode"]/div/a/text()');
|
final namess = xpath(res, '//*[@class="episode"]/div/a/text()');
|
||||||
List<String> names = [];
|
List<String> names = [];
|
||||||
for (var name in namess) {
|
for (var name in namess) {
|
||||||
names.add(MBridge.regExp(
|
names.add(regExp(
|
||||||
name,
|
name,
|
||||||
r'(?<=\bS\d\s*|)\d{2}\s*(?=\b(Vostfr|vostfr|VF|Vf|vf|\(VF\)|\(vf\)|\(Vf\)|\(Vostfr\)\b))?',
|
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)', ''));
|
.replaceAll(' (Vostfr)', ''));
|
||||||
}
|
}
|
||||||
final images =
|
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++) {
|
for (var i = 0; i < names.length; i++) {
|
||||||
MManga anime = MManga();
|
MManga anime = MManga();
|
||||||
@@ -67,24 +67,24 @@ class OtakuFr extends MSourceProvider {
|
|||||||
anime.link = urls[i];
|
anime.link = urls[i];
|
||||||
animeList.add(anime);
|
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);
|
return MPages(animeList, nextPage.isNotEmpty);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> search(MSource sourceInfo, String query, int page) async {
|
Future<MPages> search(MSource source, String query, int page) async {
|
||||||
final data = {
|
final data = {
|
||||||
"url":
|
"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 = [];
|
List<MManga> animeList = [];
|
||||||
final urls =
|
final urls =
|
||||||
MBridge.xpath(res, '//*[@class="list"]/article/div/div/figure/a/@href');
|
xpath(res, '//*[@class="list"]/article/div/div/figure/a/@href');
|
||||||
final names = MBridge.xpath(
|
final names = xpath(
|
||||||
res, '//*[@class="list"]/article/div/div/figure/a/img/@title');
|
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');
|
res, '//*[@class="list"]/article/div/div/figure/a/img/@src');
|
||||||
|
|
||||||
for (var i = 0; i < names.length; i++) {
|
for (var i = 0; i < names.length; i++) {
|
||||||
@@ -94,12 +94,12 @@ class OtakuFr extends MSourceProvider {
|
|||||||
anime.link = urls[i];
|
anime.link = urls[i];
|
||||||
animeList.add(anime);
|
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);
|
return MPages(animeList, nextPage.isNotEmpty);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MManga> getDetail(MSource sourceInfo, String url) async {
|
Future<MManga> getDetail(MSource source, String url) async {
|
||||||
final statusList = [
|
final statusList = [
|
||||||
{
|
{
|
||||||
"En cours": 0,
|
"En cours": 0,
|
||||||
@@ -107,43 +107,43 @@ class OtakuFr extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
final data = {"url": url};
|
final data = {"url": url};
|
||||||
String res = await MBridge.http('GET', json.encode(data));
|
String res = await http('GET', json.encode(data));
|
||||||
MManga anime = MManga();
|
MManga anime = MManga();
|
||||||
final originalUrl = MBridge.xpath(res,
|
final originalUrl = xpath(res,
|
||||||
'//*[@class="breadcrumb"]/li[@class="breadcrumb-item"][2]/a/@href')
|
'//*[@class="breadcrumb"]/li[@class="breadcrumb-item"][2]/a/@href')
|
||||||
.first;
|
.first;
|
||||||
if (originalUrl.isNotEmpty) {
|
if (originalUrl.isNotEmpty) {
|
||||||
final newData = {"url": originalUrl};
|
final newData = {"url": originalUrl};
|
||||||
res = await MBridge.http('GET', json.encode(newData));
|
res = await http('GET', json.encode(newData));
|
||||||
}
|
}
|
||||||
|
|
||||||
anime.description =
|
anime.description =
|
||||||
MBridge.xpath(res, '//*[@class="episode fz-sm synop"]/p/text()')
|
xpath(res, '//*[@class="episode fz-sm synop"]/p/text()')
|
||||||
.first
|
.first
|
||||||
.replaceAll("Synopsis:", "");
|
.replaceAll("Synopsis:", "");
|
||||||
final status = MBridge.xpath(res,
|
final status = xpath(res,
|
||||||
'//*[@class="list-unstyled"]/li[contains(text(),"Statut")]/text()')
|
'//*[@class="list-unstyled"]/li[contains(text(),"Statut")]/text()')
|
||||||
.first
|
.first
|
||||||
.replaceAll("Statut: ", "");
|
.replaceAll("Statut: ", "");
|
||||||
anime.status = MBridge.parseStatus(status, statusList);
|
anime.status = parseStatus(status, statusList);
|
||||||
anime.genre = MBridge.xpath(res,
|
anime.genre = xpath(res,
|
||||||
'//*[@class="list-unstyled"]/li[contains(text(),"Genre")]/ul/li/a/text()');
|
'//*[@class="list-unstyled"]/li[contains(text(),"Genre")]/ul/li/a/text()');
|
||||||
|
|
||||||
final epUrls =
|
final epUrls =
|
||||||
MBridge.xpath(res, '//*[@class="list-episodes list-group"]/a/@href');
|
xpath(res, '//*[@class="list-episodes list-group"]/a/@href');
|
||||||
final dates = MBridge.xpath(
|
final dates = xpath(
|
||||||
res, '//*[@class="list-episodes list-group"]/a/span/text()');
|
res, '//*[@class="list-episodes list-group"]/a/span/text()');
|
||||||
final names =
|
final names =
|
||||||
MBridge.xpath(res, '//*[@class="list-episodes list-group"]/a/text()');
|
xpath(res, '//*[@class="list-episodes list-group"]/a/text()');
|
||||||
List<String> episodes = [];
|
List<String> episodes = [];
|
||||||
|
|
||||||
for (var i = 0; i < names.length; i++) {
|
for (var i = 0; i < names.length; i++) {
|
||||||
final date = dates[i];
|
final date = dates[i];
|
||||||
final name = names[i];
|
final name = names[i];
|
||||||
episodes.add(
|
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 = [];
|
List<MChapter>? episodesList = [];
|
||||||
for (var i = 0; i < episodes.length; i++) {
|
for (var i = 0; i < episodes.length; i++) {
|
||||||
@@ -159,11 +159,11 @@ class OtakuFr extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<MVideo>> getVideoList(MSource sourceInfo, String url) async {
|
Future<List<MVideo>> getVideoList(MSource source, String url) async {
|
||||||
final res = await MBridge.http('GET', json.encode({"url": url}));
|
final res = await http('GET', json.encode({"url": url}));
|
||||||
|
|
||||||
final servers =
|
final servers =
|
||||||
MBridge.xpath(res, '//*[@id="nav-tabContent"]/div/iframe/@src');
|
xpath(res, '//*[@id="nav-tabContent"]/div/iframe/@src');
|
||||||
List<MVideo> videos = [];
|
List<MVideo> videos = [];
|
||||||
for (var url in servers) {
|
for (var url in servers) {
|
||||||
final datasServer = {
|
final datasServer = {
|
||||||
@@ -171,20 +171,20 @@ class OtakuFr extends MSourceProvider {
|
|||||||
"headers": {"X-Requested-With": "XMLHttpRequest"}
|
"headers": {"X-Requested-With": "XMLHttpRequest"}
|
||||||
};
|
};
|
||||||
|
|
||||||
final resServer = await MBridge.http('GET', json.encode(datasServer));
|
final resServer = await http('GET', json.encode(datasServer));
|
||||||
final serverUrl =
|
final serverUrl =
|
||||||
fixUrl(MBridge.regExp(resServer, r"data-url='([^']+)'", '', 1, 1));
|
fixUrl(regExp(resServer, r"data-url='([^']+)'", '', 1, 1));
|
||||||
List<MVideo> a = [];
|
List<MVideo> a = [];
|
||||||
if (serverUrl.contains("https://streamwish")) {
|
if (serverUrl.contains("https://streamwish")) {
|
||||||
a = await MBridge.streamWishExtractor(serverUrl, "StreamWish");
|
a = await streamWishExtractor(serverUrl, "StreamWish");
|
||||||
} else if (serverUrl.contains("sibnet")) {
|
} else if (serverUrl.contains("sibnet")) {
|
||||||
a = await MBridge.sibnetExtractor(serverUrl);
|
a = await sibnetExtractor(serverUrl);
|
||||||
} else if (serverUrl.contains("https://doo")) {
|
} else if (serverUrl.contains("https://doo")) {
|
||||||
a = await MBridge.doodExtractor(serverUrl);
|
a = await doodExtractor(serverUrl);
|
||||||
} else if (serverUrl.contains("https://voe.sx")) {
|
} 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")) {
|
} else if (serverUrl.contains("https://ok.ru")) {
|
||||||
a = await MBridge.okruExtractor(serverUrl);
|
a = await okruExtractor(serverUrl);
|
||||||
}
|
}
|
||||||
videos.addAll(a);
|
videos.addAll(a);
|
||||||
}
|
}
|
||||||
@@ -193,11 +193,11 @@ class OtakuFr extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String fixUrl(String url) {
|
String fixUrl(String url) {
|
||||||
return MBridge.regExp(url, r"^(?:(?:https?:)?//|www\.)", 'https://', 0, 0);
|
return regExp(url, r"^(?:(?:https?:)?//|www\.)", 'https://', 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<String>> getPageList(MSource sourceInfo, String url) async {
|
Future<List<String>> getPageList(MSource source, String url) async {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
import 'package:mangayomi/bridge_lib.dart';
|
import 'package:mangayomi/bridge_lib.dart';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
class HeanCms extends MSourceProvider {
|
class HeanCms extends MProvider {
|
||||||
HeanCms();
|
HeanCms();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> getPopular(MSource sourceInfo, int page) async {
|
Future<MPages> getPopular(MSource source, int page) async {
|
||||||
final headers = getHeader(sourceInfo.baseUrl);
|
final headers = getHeader(source.baseUrl);
|
||||||
String res = "";
|
String res = "";
|
||||||
if (!useNewQueryEndpoint(sourceInfo.name)) {
|
if (!useNewQueryEndpoint(source.name)) {
|
||||||
final url = "${sourceInfo.apiUrl}/series/querysearch";
|
final url = "${source.apiUrl}/series/querysearch";
|
||||||
|
|
||||||
final body = {
|
final body = {
|
||||||
"page": page,
|
"page": page,
|
||||||
@@ -19,23 +19,23 @@ class HeanCms extends MSourceProvider {
|
|||||||
"series_type": "Comic"
|
"series_type": "Comic"
|
||||||
};
|
};
|
||||||
final data = {"url": url, "headers": headers, "body": body};
|
final data = {"url": url, "headers": headers, "body": body};
|
||||||
res = await MBridge.http('POST', json.encode(data));
|
res = await http('POST', json.encode(data));
|
||||||
} else {
|
} else {
|
||||||
final newEndpointUrl =
|
final newEndpointUrl =
|
||||||
"${sourceInfo.apiUrl}/query/?page=$page&query_string=&series_status=All&order=desc&orderBy=total_views&perPage=12&tags_ids=[]&series_type=Comic";
|
"${source.apiUrl}/query/?page=$page&query_string=&series_status=All&order=desc&orderBy=total_views&perPage=12&tags_ids=[]&series_type=Comic";
|
||||||
|
|
||||||
final newEndpointData = {"url": newEndpointUrl, "headers": headers};
|
final newEndpointData = {"url": newEndpointUrl, "headers": headers};
|
||||||
res = await MBridge.http('GET', json.encode(newEndpointData));
|
res = await http('GET', json.encode(newEndpointData));
|
||||||
}
|
}
|
||||||
return mMangaRes(res, sourceInfo);
|
return mMangaRes(res, source);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> getLatestUpdates(MSource sourceInfo, int page) async {
|
Future<MPages> getLatestUpdates(MSource source, int page) async {
|
||||||
final headers = getHeader(sourceInfo.baseUrl);
|
final headers = getHeader(source.baseUrl);
|
||||||
String res = "";
|
String res = "";
|
||||||
if (!useNewQueryEndpoint(sourceInfo.name)) {
|
if (!useNewQueryEndpoint(source.name)) {
|
||||||
final url = "${sourceInfo.apiUrl}/series/querysearch";
|
final url = "${source.apiUrl}/series/querysearch";
|
||||||
final body = {
|
final body = {
|
||||||
"page": page,
|
"page": page,
|
||||||
"order": "desc",
|
"order": "desc",
|
||||||
@@ -44,55 +44,54 @@ class HeanCms extends MSourceProvider {
|
|||||||
"series_type": "Comic"
|
"series_type": "Comic"
|
||||||
};
|
};
|
||||||
final data = {"url": url, "headers": headers, "body": body};
|
final data = {"url": url, "headers": headers, "body": body};
|
||||||
res = await MBridge.http('POST', json.encode(data));
|
res = await http('POST', json.encode(data));
|
||||||
} else {
|
} else {
|
||||||
final newEndpointUrl =
|
final newEndpointUrl =
|
||||||
"${sourceInfo.apiUrl}/query/?page=$page&query_string=&series_status=All&order=desc&orderBy=latest&perPage=12&tags_ids=[]&series_type=Comic";
|
"${source.apiUrl}/query/?page=$page&query_string=&series_status=All&order=desc&orderBy=latest&perPage=12&tags_ids=[]&series_type=Comic";
|
||||||
|
|
||||||
final newEndpointData = {"url": newEndpointUrl, "headers": headers};
|
final newEndpointData = {"url": newEndpointUrl, "headers": headers};
|
||||||
res = await MBridge.http('GET', json.encode(newEndpointData));
|
res = await http('GET', json.encode(newEndpointData));
|
||||||
}
|
}
|
||||||
return mMangaRes(res, sourceInfo);
|
return mMangaRes(res, source);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> search(MSource sourceInfo, String query, int page) async {
|
Future<MPages> search(MSource source, String query, int page) async {
|
||||||
final headers = getHeader(sourceInfo.baseUrl);
|
final headers = getHeader(source.baseUrl);
|
||||||
String res = "";
|
String res = "";
|
||||||
if (!useNewQueryEndpoint(sourceInfo.source)) {
|
if (!useNewQueryEndpoint(source.source)) {
|
||||||
final url = "${sourceInfo.apiUrl}/series/search";
|
final url = "${source.apiUrl}/series/search";
|
||||||
final body = {"term": query};
|
final body = {"term": query};
|
||||||
final data = {"url": url, "headers": headers, "body": body};
|
final data = {"url": url, "headers": headers, "body": body};
|
||||||
res = await MBridge.http('POST', json.encode(data));
|
res = await http('POST', json.encode(data));
|
||||||
} else {
|
} else {
|
||||||
final newEndpointUrl =
|
final newEndpointUrl =
|
||||||
"${sourceInfo.apiUrl}/query/?page=$page&query_string=$query&series_status=All&order=desc&orderBy=total_views&perPage=12&tags_ids=[]&series_type=Comic";
|
"${source.apiUrl}/query/?page=$page&query_string=$query&series_status=All&order=desc&orderBy=total_views&perPage=12&tags_ids=[]&series_type=Comic";
|
||||||
|
|
||||||
final newEndpointData = {"url": newEndpointUrl, "headers": headers};
|
final newEndpointData = {"url": newEndpointUrl, "headers": headers};
|
||||||
res = await MBridge.http('GET', json.encode(newEndpointData));
|
res = await http('GET', json.encode(newEndpointData));
|
||||||
}
|
}
|
||||||
return mMangaRes(res, sourceInfo);
|
return mMangaRes(res, source);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MManga> getDetail(MSource sourceInfo, String url) async {
|
Future<MManga> getDetail(MSource source, String url) async {
|
||||||
MManga manga = MManga();
|
MManga manga = MManga();
|
||||||
String currentSlug = MBridge.substringAfterLast(url, "/");
|
String currentSlug = substringAfterLast(url, "/");
|
||||||
final headers = getHeader(sourceInfo.baseUrl);
|
final headers = getHeader(source.baseUrl);
|
||||||
final data = {
|
final data = {
|
||||||
"url": "${sourceInfo.apiUrl}/series/$currentSlug",
|
"url": "${source.apiUrl}/series/$currentSlug",
|
||||||
"headers": headers
|
"headers": headers
|
||||||
};
|
};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
manga.author = MBridge.getMapValue(res, "author");
|
manga.author = getMapValue(res, "author");
|
||||||
manga.description = MBridge.getMapValue(res, "description");
|
manga.description = getMapValue(res, "description");
|
||||||
manga.genre =
|
manga.genre = jsonPathToString(res, r"$.tags[*].name", "._").split("._");
|
||||||
MBridge.jsonPathToString(res, r"$.tags[*].name", "._").split("._");
|
|
||||||
List<String> chapterTitles = [];
|
List<String> chapterTitles = [];
|
||||||
List<String> chapterUrls = [];
|
List<String> chapterUrls = [];
|
||||||
List<String> chapterDates = [];
|
List<String> chapterDates = [];
|
||||||
|
|
||||||
if (!useNewQueryEndpoint(sourceInfo.name)) {
|
if (!useNewQueryEndpoint(source.name)) {
|
||||||
for (var chapter in json.decode(res)["chapters"]) {
|
for (var chapter in json.decode(res)["chapters"]) {
|
||||||
final chapterName = chapter["chapter_name"];
|
final chapterName = chapter["chapter_name"];
|
||||||
final chapterSlug = chapter["chapter_slug"];
|
final chapterSlug = chapter["chapter_slug"];
|
||||||
@@ -114,8 +113,7 @@ class HeanCms extends MSourceProvider {
|
|||||||
chapterDates.add(createdAt);
|
chapterDates.add(createdAt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final dateUploads =
|
final dateUploads = parseDates(chapterDates, "dd MMMM yyyy", "fr");
|
||||||
MBridge.parseDates(chapterDates, "dd MMMM yyyy", "fr");
|
|
||||||
List<MChapter>? chaptersList = [];
|
List<MChapter>? chaptersList = [];
|
||||||
for (var i = 0; i < chapterTitles.length; i++) {
|
for (var i = 0; i < chapterTitles.length; i++) {
|
||||||
MChapter chapter = MChapter();
|
MChapter chapter = MChapter();
|
||||||
@@ -124,7 +122,7 @@ class HeanCms extends MSourceProvider {
|
|||||||
chapter.dateUpload = dateUploads[i];
|
chapter.dateUpload = dateUploads[i];
|
||||||
chaptersList.add(chapter);
|
chaptersList.add(chapter);
|
||||||
}
|
}
|
||||||
if (!useNewQueryEndpoint(sourceInfo.name)) {
|
if (!useNewQueryEndpoint(source.name)) {
|
||||||
chaptersList = chaptersList.reversed.toList();
|
chaptersList = chaptersList.reversed.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,48 +131,48 @@ class HeanCms extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<String>> getPageList(MSource sourceInfo, String url) async {
|
Future<List<String>> getPageList(MSource source, String url) async {
|
||||||
final headers = getHeader(sourceInfo.baseUrl);
|
final headers = getHeader(source.baseUrl);
|
||||||
|
|
||||||
String res = "".toString();
|
String res = "".toString();
|
||||||
if (!useslugStrategy(sourceInfo.name)) {
|
if (!useslugStrategy(source.name)) {
|
||||||
String chapterId = MBridge.substringAfter(url, '#');
|
String chapterId = substringAfter(url, '#');
|
||||||
final data = {
|
final data = {
|
||||||
"url": "${sourceInfo.apiUrl}/series/chapter/$chapterId",
|
"url": "${source.apiUrl}/series/chapter/$chapterId",
|
||||||
"headers": headers
|
"headers": headers
|
||||||
};
|
};
|
||||||
res = await MBridge.http('GET', json.encode(data));
|
res = await http('GET', json.encode(data));
|
||||||
} else {
|
} else {
|
||||||
final data = {"url": "${sourceInfo.baseUrl}$url", "headers": headers};
|
final data = {"url": "${source.baseUrl}$url", "headers": headers};
|
||||||
res = await MBridge.http('GET', json.encode(data));
|
res = await http('GET', json.encode(data));
|
||||||
|
|
||||||
List<String> pageUrls = [];
|
List<String> pageUrls = [];
|
||||||
var imagesRes = MBridge.querySelectorAll(res,
|
var imagesRes = querySelectorAll(res,
|
||||||
selector: "div.min-h-screen > div.container > p.items-center",
|
selector: "div.min-h-screen > div.container > p.items-center",
|
||||||
typeElement: 1,
|
typeElement: 1,
|
||||||
attributes: "",
|
attributes: "",
|
||||||
typeRegExp: 0);
|
typeRegExp: 0);
|
||||||
pageUrls = MBridge.xpath(imagesRes.first, '//img/@src');
|
pageUrls = xpath(imagesRes.first, '//img/@src');
|
||||||
|
|
||||||
pageUrls.addAll(MBridge.xpath(imagesRes.first, '//img/@data-src'));
|
pageUrls.addAll(xpath(imagesRes.first, '//img/@data-src'));
|
||||||
|
|
||||||
return pageUrls.where((e) => e.isNotEmpty).toList();
|
return pageUrls.where((e) => e.isNotEmpty).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
final pages = MBridge.jsonPathToList(res, r"$.content.images[*]", 0);
|
final pages = jsonPathToList(res, r"$.content.images[*]", 0);
|
||||||
List<String> pageUrls = [];
|
List<String> pageUrls = [];
|
||||||
for (var u in pages) {
|
for (var u in pages) {
|
||||||
final url = u.replaceAll('"', "");
|
final url = u.replaceAll('"', "");
|
||||||
if (url.startsWith("http")) {
|
if (url.startsWith("http")) {
|
||||||
pageUrls.add(url);
|
pageUrls.add(url);
|
||||||
} else {
|
} else {
|
||||||
pageUrls.add("${sourceInfo.apiUrl}/$url");
|
pageUrls.add("${source.apiUrl}/$url");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return pageUrls;
|
return pageUrls;
|
||||||
}
|
}
|
||||||
|
|
||||||
MPages mMangaRes(String res, MSource sourceInfo) {
|
MPages mMangaRes(String res, MSource source) {
|
||||||
bool hasNextPage = true;
|
bool hasNextPage = true;
|
||||||
List<MManga> mangaList = [];
|
List<MManga> mangaList = [];
|
||||||
List<String> names = [];
|
List<String> names = [];
|
||||||
@@ -186,7 +184,7 @@ class HeanCms extends MSourceProvider {
|
|||||||
if (thumbnail.startsWith("https://")) {
|
if (thumbnail.startsWith("https://")) {
|
||||||
images.add(thumbnail);
|
images.add(thumbnail);
|
||||||
} else {
|
} else {
|
||||||
images.add("${sourceInfo.apiUrl}/cover/$thumbnail");
|
images.add("${source.apiUrl}/cover/$thumbnail");
|
||||||
}
|
}
|
||||||
names.add(a["title"]);
|
names.add(a["title"]);
|
||||||
final seriesSlug = a["series_slug"];
|
final seriesSlug = a["series_slug"];
|
||||||
@@ -198,7 +196,7 @@ class HeanCms extends MSourceProvider {
|
|||||||
if (thumbnail.startsWith("https://")) {
|
if (thumbnail.startsWith("https://")) {
|
||||||
images.add(thumbnail);
|
images.add(thumbnail);
|
||||||
} else {
|
} else {
|
||||||
images.add("${sourceInfo.apiUrl}/cover/$thumbnail");
|
images.add("${source.apiUrl}/cover/$thumbnail");
|
||||||
}
|
}
|
||||||
names.add(a["title"]);
|
names.add(a["title"]);
|
||||||
final seriesSlug = a["series_slug"];
|
final seriesSlug = a["series_slug"];
|
||||||
@@ -217,16 +215,6 @@ class HeanCms extends MSourceProvider {
|
|||||||
return MPages(mangaList, hasNextPage);
|
return MPages(mangaList, hasNextPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, String> getHeader(String url) {
|
|
||||||
final headers = {
|
|
||||||
'Origin': url,
|
|
||||||
'Referer': '$url/',
|
|
||||||
'Accept': 'application/json, text/plain, */*',
|
|
||||||
'Content-Type': 'application/json'
|
|
||||||
};
|
|
||||||
return headers;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool useNewQueryEndpoint(String sourceName) {
|
bool useNewQueryEndpoint(String sourceName) {
|
||||||
List<String> sources = ["YugenMangas", "Perf Scan", "Reaper Scans"];
|
List<String> sources = ["YugenMangas", "Perf Scan", "Reaper Scans"];
|
||||||
return sources.contains(sourceName);
|
return sources.contains(sourceName);
|
||||||
@@ -238,11 +226,21 @@ class HeanCms extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<MVideo>> getVideoList(MSource sourceInfo, String url) async {
|
Future<List<MVideo>> getVideoList(MSource source, String url) async {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Map<String, String> getHeader(String url) {
|
||||||
|
final headers = {
|
||||||
|
'Origin': url,
|
||||||
|
'Referer': '$url/',
|
||||||
|
'Accept': 'application/json, text/plain, */*',
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
};
|
||||||
|
return headers;
|
||||||
|
}
|
||||||
|
|
||||||
HeanCms main() {
|
HeanCms main() {
|
||||||
return HeanCms();
|
return HeanCms();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,26 +1,26 @@
|
|||||||
import 'package:mangayomi/bridge_lib.dart';
|
import 'package:mangayomi/bridge_lib.dart';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
class Madara extends MSourceProvider {
|
class Madara extends MProvider {
|
||||||
Madara();
|
Madara();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> getPopular(MSource sourceInfo, int page) async {
|
Future<MPages> getPopular(MSource source, int page) async {
|
||||||
final url = "${sourceInfo.baseUrl}/manga/page/$page/?m_orderby=views";
|
final url = "${source.baseUrl}/manga/page/$page/?m_orderby=views";
|
||||||
final data = {"url": url, "sourceId": sourceInfo.id};
|
final data = {"url": url, "sourceId": source.id};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
|
|
||||||
List<MManga> mangaList = [];
|
List<MManga> mangaList = [];
|
||||||
final urls = MBridge.xpath(res, '//*[@class^="post-title"]/h3/a/@href');
|
final urls = xpath(res, '//*[@class^="post-title"]/h3/a/@href');
|
||||||
final names = MBridge.xpath(res, '//*[@id^="manga-item"]/a/@title');
|
final names = xpath(res, '//*[@id^="manga-item"]/a/@title');
|
||||||
var images = MBridge.xpath(res, '//*[@id^="manga-item"]/a/img/@data-src');
|
var images = xpath(res, '//*[@id^="manga-item"]/a/img/@data-src');
|
||||||
if (images.isEmpty) {
|
if (images.isEmpty) {
|
||||||
images =
|
images =
|
||||||
MBridge.xpath(res, '//*[@id^="manga-item"]/a/img/@data-lazy-src');
|
xpath(res, '//*[@id^="manga-item"]/a/img/@data-lazy-src');
|
||||||
if (images.isEmpty) {
|
if (images.isEmpty) {
|
||||||
images = MBridge.xpath(res, '//*[@id^="manga-item"]/a/img/@srcset');
|
images = xpath(res, '//*[@id^="manga-item"]/a/img/@srcset');
|
||||||
if (images.isEmpty) {
|
if (images.isEmpty) {
|
||||||
images = MBridge.xpath(res, '//*[@id^="manga-item"]/a/img/@src');
|
images = xpath(res, '//*[@id^="manga-item"]/a/img/@src');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -37,22 +37,22 @@ class Madara extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> getLatestUpdates(MSource sourceInfo, int page) async {
|
Future<MPages> getLatestUpdates(MSource source, int page) async {
|
||||||
final url = "${sourceInfo.baseUrl}/manga/page/$page/?m_orderby=latest";
|
final url = "${source.baseUrl}/manga/page/$page/?m_orderby=latest";
|
||||||
final data = {"url": url, "sourceId": sourceInfo.id};
|
final data = {"url": url, "sourceId": source.id};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
|
|
||||||
List<MManga> mangaList = [];
|
List<MManga> mangaList = [];
|
||||||
final urls = MBridge.xpath(res, '//*[@class^="post-title"]/h3/a/@href');
|
final urls = xpath(res, '//*[@class^="post-title"]/h3/a/@href');
|
||||||
final names = MBridge.xpath(res, '//*[@id^="manga-item"]/a/@title');
|
final names = xpath(res, '//*[@id^="manga-item"]/a/@title');
|
||||||
var images = MBridge.xpath(res, '//*[@id^="manga-item"]/a/img/@data-src');
|
var images = xpath(res, '//*[@id^="manga-item"]/a/img/@data-src');
|
||||||
if (images.isEmpty) {
|
if (images.isEmpty) {
|
||||||
images =
|
images =
|
||||||
MBridge.xpath(res, '//*[@id^="manga-item"]/a/img/@data-lazy-src');
|
xpath(res, '//*[@id^="manga-item"]/a/img/@data-lazy-src');
|
||||||
if (images.isEmpty) {
|
if (images.isEmpty) {
|
||||||
images = MBridge.xpath(res, '//*[@id^="manga-item"]/a/img/@srcset');
|
images = xpath(res, '//*[@id^="manga-item"]/a/img/@srcset');
|
||||||
if (images.isEmpty) {
|
if (images.isEmpty) {
|
||||||
images = MBridge.xpath(res, '//*[@id^="manga-item"]/a/img/@src');
|
images = xpath(res, '//*[@id^="manga-item"]/a/img/@src');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -69,28 +69,28 @@ class Madara extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> search(MSource sourceInfo, String query, int page) async {
|
Future<MPages> search(MSource source, String query, int page) async {
|
||||||
final data = {
|
final data = {
|
||||||
"url": "${sourceInfo.baseUrl}/?s=$query&post_type=wp-manga",
|
"url": "${source.baseUrl}/?s=$query&post_type=wp-manga",
|
||||||
"sourceId": sourceInfo.id
|
"sourceId": source.id
|
||||||
};
|
};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
|
|
||||||
List<MManga> mangaList = [];
|
List<MManga> mangaList = [];
|
||||||
final urls =
|
final urls =
|
||||||
MBridge.xpath(res, '//*[@class^="tab-thumb c-image-hover"]/a/@href');
|
xpath(res, '//*[@class^="tab-thumb c-image-hover"]/a/@href');
|
||||||
final names =
|
final names =
|
||||||
MBridge.xpath(res, '//*[@class^="tab-thumb c-image-hover"]/a/@title');
|
xpath(res, '//*[@class^="tab-thumb c-image-hover"]/a/@title');
|
||||||
var images = MBridge.xpath(
|
var images = xpath(
|
||||||
res, '//*[@class^="tab-thumb c-image-hover"]/a/img/@data-src');
|
res, '//*[@class^="tab-thumb c-image-hover"]/a/img/@data-src');
|
||||||
if (images.isEmpty) {
|
if (images.isEmpty) {
|
||||||
images = MBridge.xpath(
|
images = xpath(
|
||||||
res, '//*[@class^="tab-thumb c-image-hover"]/a/img/@data-lazy-src');
|
res, '//*[@class^="tab-thumb c-image-hover"]/a/img/@data-lazy-src');
|
||||||
if (images.isEmpty) {
|
if (images.isEmpty) {
|
||||||
images = MBridge.xpath(
|
images = xpath(
|
||||||
res, '//*[@class^="tab-thumb c-image-hover"]/a/img/@srcset');
|
res, '//*[@class^="tab-thumb c-image-hover"]/a/img/@srcset');
|
||||||
if (images.isEmpty) {
|
if (images.isEmpty) {
|
||||||
images = MBridge.xpath(
|
images = xpath(
|
||||||
res, '//*[@class^="tab-thumb c-image-hover"]/a/img/@src');
|
res, '//*[@class^="tab-thumb c-image-hover"]/a/img/@src');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -108,7 +108,7 @@ class Madara extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MManga> getDetail(MSource sourceInfo, String url) async {
|
Future<MManga> getDetail(MSource source, String url) async {
|
||||||
final statusList = [
|
final statusList = [
|
||||||
{
|
{
|
||||||
"OnGoing": 0,
|
"OnGoing": 0,
|
||||||
@@ -155,36 +155,36 @@ class Madara extends MSourceProvider {
|
|||||||
];
|
];
|
||||||
MManga manga = MManga();
|
MManga manga = MManga();
|
||||||
String res = "";
|
String res = "";
|
||||||
final datas = {"url": url, "sourceId": sourceInfo.id};
|
final datas = {"url": url, "sourceId": source.id};
|
||||||
res = await MBridge.http('GET', json.encode(datas));
|
res = await http('GET', json.encode(datas));
|
||||||
|
|
||||||
manga.author = MBridge.querySelectorAll(res,
|
manga.author = querySelectorAll(res,
|
||||||
selector: "div.author-content > a",
|
selector: "div.author-content > a",
|
||||||
typeElement: 0,
|
typeElement: 0,
|
||||||
attributes: "",
|
attributes: "",
|
||||||
typeRegExp: 0)
|
typeRegExp: 0)
|
||||||
.first;
|
.first;
|
||||||
manga.description = MBridge.querySelectorAll(res,
|
manga.description = querySelectorAll(res,
|
||||||
selector:
|
selector:
|
||||||
"div.description-summary div.summary__content, div.summary_content div.post-content_item > h5 + div, div.summary_content div.manga-excerpt, div.sinopsis div.contenedor, .description-summary > p",
|
"div.description-summary div.summary__content, div.summary_content div.post-content_item > h5 + div, div.summary_content div.manga-excerpt, div.sinopsis div.contenedor, .description-summary > p",
|
||||||
typeElement: 0,
|
typeElement: 0,
|
||||||
attributes: "",
|
attributes: "",
|
||||||
typeRegExp: 0)
|
typeRegExp: 0)
|
||||||
.first;
|
.first;
|
||||||
manga.imageUrl = MBridge.querySelectorAll(res,
|
manga.imageUrl = querySelectorAll(res,
|
||||||
selector: "div.summary_image img",
|
selector: "div.summary_image img",
|
||||||
typeElement: 2,
|
typeElement: 2,
|
||||||
attributes: "",
|
attributes: "",
|
||||||
typeRegExp: 2)
|
typeRegExp: 2)
|
||||||
.first;
|
.first;
|
||||||
final mangaId = MBridge.querySelectorAll(res,
|
final mangaId = querySelectorAll(res,
|
||||||
selector: "div[id^=manga-chapters-holder]",
|
selector: "div[id^=manga-chapters-holder]",
|
||||||
typeElement: 3,
|
typeElement: 3,
|
||||||
attributes: "data-id",
|
attributes: "data-id",
|
||||||
typeRegExp: 0)
|
typeRegExp: 0)
|
||||||
.first;
|
.first;
|
||||||
manga.status = MBridge.parseStatus(
|
manga.status = parseStatus(
|
||||||
MBridge.querySelectorAll(res,
|
querySelectorAll(res,
|
||||||
selector: "div.summary-content",
|
selector: "div.summary-content",
|
||||||
typeElement: 0,
|
typeElement: 0,
|
||||||
attributes: "",
|
attributes: "",
|
||||||
@@ -192,13 +192,13 @@ class Madara extends MSourceProvider {
|
|||||||
.last,
|
.last,
|
||||||
statusList);
|
statusList);
|
||||||
|
|
||||||
manga.genre = MBridge.querySelectorAll(res,
|
manga.genre = querySelectorAll(res,
|
||||||
selector: "div.genres-content a",
|
selector: "div.genres-content a",
|
||||||
typeElement: 0,
|
typeElement: 0,
|
||||||
attributes: "",
|
attributes: "",
|
||||||
typeRegExp: 0);
|
typeRegExp: 0);
|
||||||
|
|
||||||
final baseUrl = "${sourceInfo.baseUrl}/";
|
final baseUrl = "${source.baseUrl}/";
|
||||||
final headers = {
|
final headers = {
|
||||||
"Referer": baseUrl,
|
"Referer": baseUrl,
|
||||||
"Content-Type": "application/x-www-form-urlencoded",
|
"Content-Type": "application/x-www-form-urlencoded",
|
||||||
@@ -206,33 +206,33 @@ class Madara extends MSourceProvider {
|
|||||||
};
|
};
|
||||||
final urll =
|
final urll =
|
||||||
"${baseUrl}wp-admin/admin-ajax.php?action=manga_get_chapters&manga=$mangaId";
|
"${baseUrl}wp-admin/admin-ajax.php?action=manga_get_chapters&manga=$mangaId";
|
||||||
final datasP = {"url": urll, "headers": headers, "sourceId": sourceInfo.id};
|
final datasP = {"url": urll, "headers": headers, "sourceId": source.id};
|
||||||
res = await MBridge.http('POST', json.encode(datasP));
|
res = await http('POST', json.encode(datasP));
|
||||||
if (res == "400") {
|
if (res == "400") {
|
||||||
final urlP = "${url}ajax/chapters";
|
final urlP = "${url}ajax/chapters";
|
||||||
final datasP = {
|
final datasP = {
|
||||||
"url": urlP,
|
"url": urlP,
|
||||||
"headers": headers,
|
"headers": headers,
|
||||||
"sourceId": sourceInfo.id
|
"sourceId": source.id
|
||||||
};
|
};
|
||||||
res = await MBridge.http('POST', json.encode(datasP));
|
res = await http('POST', json.encode(datasP));
|
||||||
}
|
}
|
||||||
|
|
||||||
var chapUrls = MBridge.xpath(res, "//li/a/@href");
|
var chapUrls = xpath(res, "//li/a/@href");
|
||||||
var chaptersNames = MBridge.xpath(res, "//li/a/text()");
|
var chaptersNames = xpath(res, "//li/a/text()");
|
||||||
var dateF = MBridge.xpath(res, "//li/span/i/text()");
|
var dateF = xpath(res, "//li/span/i/text()");
|
||||||
if (dateF.isEmpty) {
|
if (dateF.isEmpty) {
|
||||||
final resWebview = await MBridge.getHtmlViaWebview(
|
final resWebview = await getHtmlViaWebview(
|
||||||
url, "//*[@id='manga-chapters-holder']/div[2]/div/ul/li/a/@href");
|
url, "//*[@id='manga-chapters-holder']/div[2]/div/ul/li/a/@href");
|
||||||
chapUrls = MBridge.xpath(resWebview,
|
chapUrls = xpath(resWebview,
|
||||||
"//*[@id='manga-chapters-holder']/div[2]/div/ul/li/a/@href");
|
"//*[@id='manga-chapters-holder']/div[2]/div/ul/li/a/@href");
|
||||||
chaptersNames = MBridge.xpath(resWebview,
|
chaptersNames = xpath(resWebview,
|
||||||
"//*[@id='manga-chapters-holder']/div[2]/div/ul/li/a/text()");
|
"//*[@id='manga-chapters-holder']/div[2]/div/ul/li/a/text()");
|
||||||
dateF = MBridge.xpath(resWebview,
|
dateF = xpath(resWebview,
|
||||||
"//*[@id='manga-chapters-holder']/div[2]/div/ul/li/span/i/text()");
|
"//*[@id='manga-chapters-holder']/div[2]/div/ul/li/span/i/text()");
|
||||||
}
|
}
|
||||||
var dateUploads = MBridge.parseDates(
|
var dateUploads = parseDates(
|
||||||
dateF, sourceInfo.dateFormat, sourceInfo.dateFormatLocale);
|
dateF, source.dateFormat, source.dateFormatLocale);
|
||||||
if (dateF.length < chaptersNames.length) {
|
if (dateF.length < chaptersNames.length) {
|
||||||
final length = chaptersNames.length - dateF.length;
|
final length = chaptersNames.length - dateF.length;
|
||||||
String date = "${DateTime.now().millisecondsSinceEpoch}";
|
String date = "${DateTime.now().millisecondsSinceEpoch}";
|
||||||
@@ -240,8 +240,8 @@ class Madara extends MSourceProvider {
|
|||||||
date += "--..${DateTime.now().millisecondsSinceEpoch}";
|
date += "--..${DateTime.now().millisecondsSinceEpoch}";
|
||||||
}
|
}
|
||||||
|
|
||||||
final dateFF = MBridge.parseDates(
|
final dateFF = parseDates(
|
||||||
dateF, sourceInfo.dateFormat, sourceInfo.dateFormatLocale);
|
dateF, source.dateFormat, source.dateFormatLocale);
|
||||||
List<String> chapterDate = date.split('--..');
|
List<String> chapterDate = date.split('--..');
|
||||||
|
|
||||||
for (var date in dateFF) {
|
for (var date in dateFF) {
|
||||||
@@ -263,36 +263,36 @@ class Madara extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<String>> getPageList(MSource sourceInfo, String url) async {
|
Future<List<String>> getPageList(MSource source, String url) async {
|
||||||
final datas = {"url": url, "sourceId": sourceInfo.id};
|
final datas = {"url": url, "sourceId": source.id};
|
||||||
final res = await MBridge.http('GET', json.encode(datas));
|
final res = await http('GET', json.encode(datas));
|
||||||
|
|
||||||
final pagesSelectorRes = MBridge.querySelectorAll(res,
|
final pagesSelectorRes = querySelectorAll(res,
|
||||||
selector:
|
selector:
|
||||||
"div.page-break, li.blocks-gallery-item, .reading-content, .text-left img",
|
"div.page-break, li.blocks-gallery-item, .reading-content, .text-left img",
|
||||||
typeElement: 1,
|
typeElement: 1,
|
||||||
attributes: "",
|
attributes: "",
|
||||||
typeRegExp: 0)
|
typeRegExp: 0)
|
||||||
.first;
|
.first;
|
||||||
final imgs = MBridge.querySelectorAll(pagesSelectorRes,
|
final imgs = querySelectorAll(pagesSelectorRes,
|
||||||
selector: "img", typeElement: 2, attributes: "", typeRegExp: 2);
|
selector: "img", typeElement: 2, attributes: "", typeRegExp: 2);
|
||||||
var pageUrls = [];
|
var pageUrls = [];
|
||||||
|
|
||||||
if (imgs.length == 1) {
|
if (imgs.length == 1) {
|
||||||
final pages = MBridge.querySelectorAll(res,
|
final pages = querySelectorAll(res,
|
||||||
selector: "#single-pager",
|
selector: "#single-pager",
|
||||||
typeElement: 2,
|
typeElement: 2,
|
||||||
attributes: "",
|
attributes: "",
|
||||||
typeRegExp: 0)
|
typeRegExp: 0)
|
||||||
.first;
|
.first;
|
||||||
|
|
||||||
final pagesNumber = MBridge.querySelectorAll(pages,
|
final pagesNumber = querySelectorAll(pages,
|
||||||
selector: "option", typeElement: 2, attributes: "", typeRegExp: 0);
|
selector: "option", typeElement: 2, attributes: "", typeRegExp: 0);
|
||||||
|
|
||||||
for (var i = 0; i < pagesNumber.length; i++) {
|
for (var i = 0; i < pagesNumber.length; i++) {
|
||||||
final val = i + 1;
|
final val = i + 1;
|
||||||
if (i.toString().length == 1) {
|
if (i.toString().length == 1) {
|
||||||
pageUrls.add(MBridge.querySelectorAll(pagesSelectorRes,
|
pageUrls.add(querySelectorAll(pagesSelectorRes,
|
||||||
selector: "img",
|
selector: "img",
|
||||||
typeElement: 2,
|
typeElement: 2,
|
||||||
attributes: "",
|
attributes: "",
|
||||||
@@ -300,7 +300,7 @@ class Madara extends MSourceProvider {
|
|||||||
.first
|
.first
|
||||||
.replaceAll("01", '0$val'));
|
.replaceAll("01", '0$val'));
|
||||||
} else {
|
} else {
|
||||||
pageUrls.add(MBridge.querySelectorAll(pagesSelectorRes,
|
pageUrls.add(querySelectorAll(pagesSelectorRes,
|
||||||
selector: "img",
|
selector: "img",
|
||||||
typeElement: 2,
|
typeElement: 2,
|
||||||
attributes: "",
|
attributes: "",
|
||||||
@@ -316,7 +316,7 @@ class Madara extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<MVideo>> getVideoList(MSource sourceInfo, String url) async {
|
Future<List<MVideo>> getVideoList(MSource source, String url) async {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,41 +1,41 @@
|
|||||||
import 'package:mangayomi/bridge_lib.dart';
|
import 'package:mangayomi/bridge_lib.dart';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
class MangaReader extends MSourceProvider {
|
class MangaReader extends MProvider {
|
||||||
MangaReader();
|
MangaReader();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> getPopular(MSource sourceInfo, int page) async {
|
Future<MPages> getPopular(MSource source, int page) async {
|
||||||
final url =
|
final url =
|
||||||
"${sourceInfo.baseUrl}${getMangaUrlDirectory(sourceInfo.name)}/?page=$page&order=popular";
|
"${source.baseUrl}${getMangaUrlDirectory(source.name)}/?page=$page&order=popular";
|
||||||
final data = {"url": url, "sourceId": sourceInfo.id};
|
final data = {"url": url, "sourceId": source.id};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
|
|
||||||
return mangaRes(res);
|
return mangaRes(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> getLatestUpdates(MSource sourceInfo, int page) async {
|
Future<MPages> getLatestUpdates(MSource source, int page) async {
|
||||||
final url =
|
final url =
|
||||||
"${sourceInfo.baseUrl}${getMangaUrlDirectory(sourceInfo.name)}/?page=$page&order=update";
|
"${source.baseUrl}${getMangaUrlDirectory(source.name)}/?page=$page&order=update";
|
||||||
final data = {"url": url, "sourceId": sourceInfo.id};
|
final data = {"url": url, "sourceId": source.id};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
|
|
||||||
return mangaRes(res);
|
return mangaRes(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> search(MSource sourceInfo, String query, int page) async {
|
Future<MPages> search(MSource source, String query, int page) async {
|
||||||
final url =
|
final url =
|
||||||
"${sourceInfo.baseUrl}${getMangaUrlDirectory(sourceInfo.name)}/?&title=$query&page=$page";
|
"${source.baseUrl}${getMangaUrlDirectory(source.name)}/?&title=$query&page=$page";
|
||||||
final data = {"url": url, "sourceId": sourceInfo.id};
|
final data = {"url": url, "sourceId": source.id};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
|
|
||||||
return mangaRes(res);
|
return mangaRes(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MManga> getDetail(MSource sourceInfo, String url) async {
|
Future<MManga> getDetail(MSource source, String url) async {
|
||||||
final statusList = [
|
final statusList = [
|
||||||
{
|
{
|
||||||
"مستمرة": 0,
|
"مستمرة": 0,
|
||||||
@@ -89,10 +89,10 @@ class MangaReader extends MSourceProvider {
|
|||||||
];
|
];
|
||||||
|
|
||||||
MManga manga = MManga();
|
MManga manga = MManga();
|
||||||
final datas = {"url": url, "sourceId": sourceInfo.id};
|
final datas = {"url": url, "sourceId": source.id};
|
||||||
final res = await MBridge.http('GET', json.encode(datas));
|
final res = await http('GET', json.encode(datas));
|
||||||
|
|
||||||
manga.author = MBridge.xpath(
|
manga.author = xpath(
|
||||||
res,
|
res,
|
||||||
'//*[@class="imptdt" and contains(text(), "Author") or @class="infotable" and contains(text(), "Author") or @class="infotable" and contains(text(), "Auteur") or @class="fmed" and contains(text(), "Auteur") or @class="infotable" and contains(text(), "Autor")]/text()',
|
'//*[@class="imptdt" and contains(text(), "Author") or @class="infotable" and contains(text(), "Author") or @class="infotable" and contains(text(), "Auteur") or @class="fmed" and contains(text(), "Auteur") or @class="infotable" and contains(text(), "Autor")]/text()',
|
||||||
'')
|
'')
|
||||||
@@ -102,14 +102,14 @@ class MangaReader extends MSourceProvider {
|
|||||||
.replaceAll("Auteur", "")
|
.replaceAll("Auteur", "")
|
||||||
.replaceAll("[Add, ]", "");
|
.replaceAll("[Add, ]", "");
|
||||||
|
|
||||||
manga.description = MBridge.querySelectorAll(res,
|
manga.description = querySelectorAll(res,
|
||||||
selector: ".desc, .entry-content[itemprop=description]",
|
selector: ".desc, .entry-content[itemprop=description]",
|
||||||
typeElement: 0,
|
typeElement: 0,
|
||||||
attributes: "",
|
attributes: "",
|
||||||
typeRegExp: 0)
|
typeRegExp: 0)
|
||||||
.first;
|
.first;
|
||||||
|
|
||||||
final status = MBridge.xpath(
|
final status = xpath(
|
||||||
res,
|
res,
|
||||||
'//*[@class="imptdt" and contains(text(), "Status") or @class="imptdt" and contains(text(), "Estado") or @class="infotable" and contains(text(), "Status") or @class="infotable" and contains(text(), "Statut") or @class="imptdt" and contains(text(), "Statut")]/text()',
|
'//*[@class="imptdt" and contains(text(), "Status") or @class="imptdt" and contains(text(), "Estado") or @class="infotable" and contains(text(), "Status") or @class="infotable" and contains(text(), "Statut") or @class="imptdt" and contains(text(), "Statut")]/text()',
|
||||||
'')
|
'')
|
||||||
@@ -118,20 +118,20 @@ class MangaReader extends MSourceProvider {
|
|||||||
.replaceAll("Estado", "")
|
.replaceAll("Estado", "")
|
||||||
.replaceAll("Statut", "");
|
.replaceAll("Statut", "");
|
||||||
|
|
||||||
manga.status = MBridge.parseStatus(status, statusList);
|
manga.status = parseStatus(status, statusList);
|
||||||
|
|
||||||
manga.genre = MBridge.xpath(res,
|
manga.genre = xpath(res,
|
||||||
'//*[@class="gnr" or @class="mgen" or @class="seriestugenre" ]/a/text()');
|
'//*[@class="gnr" or @class="mgen" or @class="seriestugenre" ]/a/text()');
|
||||||
|
|
||||||
var chapUrls = MBridge.xpath(res,
|
var chapUrls = xpath(res,
|
||||||
'//*[@class="bxcl" or @class="cl" or @class="chbox" or @class="eph-num" or @id="chapterlist"]/div/a[not(@href="#/chapter-{{number}}")]/@href');
|
'//*[@class="bxcl" or @class="cl" or @class="chbox" or @class="eph-num" or @id="chapterlist"]/div/a[not(@href="#/chapter-{{number}}")]/@href');
|
||||||
var chaptersNames = MBridge.xpath(res,
|
var chaptersNames = xpath(res,
|
||||||
'//*[@class="bxcl" or @class="cl" or @class="chbox" or @class="eph-num" or @id="chapterlist"]/div/a/span[@class="chapternum" and not(text()="Chapter {{number}}") or @class="lch" and not(text()="Chapter {{number}}")]/text()');
|
'//*[@class="bxcl" or @class="cl" or @class="chbox" or @class="eph-num" or @id="chapterlist"]/div/a/span[@class="chapternum" and not(text()="Chapter {{number}}") or @class="lch" and not(text()="Chapter {{number}}")]/text()');
|
||||||
var chapterDates = MBridge.xpath(res,
|
var chapterDates = xpath(res,
|
||||||
'//*[@class="bxcl" or @class="cl" or @class="chbox" or @class="eph-num" or @id="chapterlist"]/div/a/span[@class="chapterdate" and not(text()="{{date}}")]/text()');
|
'//*[@class="bxcl" or @class="cl" or @class="chbox" or @class="eph-num" or @id="chapterlist"]/div/a/span[@class="chapterdate" and not(text()="{{date}}")]/text()');
|
||||||
|
|
||||||
var dateUploads = MBridge.parseDates(
|
var dateUploads = parseDates(
|
||||||
chapterDates, sourceInfo.dateFormat, sourceInfo.dateFormatLocale);
|
chapterDates, source.dateFormat, source.dateFormatLocale);
|
||||||
|
|
||||||
List<MChapter>? chaptersList = [];
|
List<MChapter>? chaptersList = [];
|
||||||
for (var i = 0; i < chaptersNames.length; i++) {
|
for (var i = 0; i < chaptersNames.length; i++) {
|
||||||
@@ -146,20 +146,20 @@ class MangaReader extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<String>> getPageList(MSource sourceInfo, String url) async {
|
Future<List<String>> getPageList(MSource source, String url) async {
|
||||||
final datas = {"url": url, "sourceId": sourceInfo.id};
|
final datas = {"url": url, "sourceId": source.id};
|
||||||
final res = await MBridge.http('GET', json.encode(datas));
|
final res = await http('GET', json.encode(datas));
|
||||||
|
|
||||||
List<String> pages = [];
|
List<String> pages = [];
|
||||||
List<String> pagesUrl = [];
|
List<String> pagesUrl = [];
|
||||||
pages = MBridge.xpath(res, '//*[@id="readerarea"]/p/img/@src');
|
pages = xpath(res, '//*[@id="readerarea"]/p/img/@src');
|
||||||
if (pages.isEmpty || pages.length == 1) {
|
if (pages.isEmpty || pages.length == 1) {
|
||||||
pages = MBridge.xpath(res, '//*[@id="readerarea"]/img/@src');
|
pages = xpath(res, '//*[@id="readerarea"]/img/@src');
|
||||||
}
|
}
|
||||||
if (pages.isEmpty || pages.length == 1) {
|
if (pages.isEmpty || pages.length == 1) {
|
||||||
final images =
|
final images =
|
||||||
MBridge.regExp(res, "\"images\"\\s*:\\s*(\\[.*?])", "", 1, 1);
|
regExp(res, "\"images\"\\s*:\\s*(\\[.*?])", "", 1, 1);
|
||||||
final pages = MBridge.jsonDecodeToList(images, 0);
|
final pages = json.decode(images) as List;
|
||||||
for (var page in pages) {
|
for (var page in pages) {
|
||||||
pagesUrl.add(page);
|
pagesUrl.add(page);
|
||||||
}
|
}
|
||||||
@@ -173,10 +173,10 @@ class MangaReader extends MSourceProvider {
|
|||||||
MPages mangaRes(String res) {
|
MPages mangaRes(String res) {
|
||||||
List<MManga> mangaList = [];
|
List<MManga> mangaList = [];
|
||||||
final urls =
|
final urls =
|
||||||
MBridge.xpath(res, '//*[ @class="imgu" or @class="bsx"]/a/@href');
|
xpath(res, '//*[ @class="imgu" or @class="bsx"]/a/@href');
|
||||||
final names =
|
final names =
|
||||||
MBridge.xpath(res, '//*[ @class="imgu" or @class="bsx"]/a/@title');
|
xpath(res, '//*[ @class="imgu" or @class="bsx"]/a/@title');
|
||||||
final images = MBridge.xpath(
|
final images = xpath(
|
||||||
res, '//*[ @class="imgu" or @class="bsx"]/a/div[1]/img/@src');
|
res, '//*[ @class="imgu" or @class="bsx"]/a/div[1]/img/@src');
|
||||||
|
|
||||||
for (var i = 0; i < names.length; i++) {
|
for (var i = 0; i < names.length; i++) {
|
||||||
@@ -198,7 +198,7 @@ class MangaReader extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<MVideo>> getVideoList(MSource sourceInfo, String url) async {
|
Future<List<MVideo>> getVideoList(MSource source, String url) async {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,27 +1,27 @@
|
|||||||
import 'package:mangayomi/bridge_lib.dart';
|
import 'package:mangayomi/bridge_lib.dart';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
class MMCRCms extends MSourceProvider {
|
class MMCRCms extends MProvider {
|
||||||
MMCRCms();
|
MMCRCms();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> getPopular(MSource sourceInfo, int page) async {
|
Future<MPages> getPopular(MSource source, int page) async {
|
||||||
final url =
|
final url =
|
||||||
"${sourceInfo.baseUrl}/filterList?page=$page&sortBy=views&asc=false";
|
"${source.baseUrl}/filterList?page=$page&sortBy=views&asc=false";
|
||||||
final data = {"url": url, "sourceId": sourceInfo.id};
|
final data = {"url": url, "sourceId": source.id};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
|
|
||||||
List<MManga> mangaList = [];
|
List<MManga> mangaList = [];
|
||||||
final urls = MBridge.xpath(res, '//*[ @class="chart-title"]/@href');
|
final urls = xpath(res, '//*[ @class="chart-title"]/@href');
|
||||||
final names = MBridge.xpath(res, '//*[ @class="chart-title"]/text()');
|
final names = xpath(res, '//*[ @class="chart-title"]/text()');
|
||||||
List<String> images = [];
|
List<String> images = [];
|
||||||
for (var url in urls) {
|
for (var url in urls) {
|
||||||
String slug = MBridge.substringAfterLast(url, '/');
|
String slug = substringAfterLast(url, '/');
|
||||||
if (sourceInfo.name == "Manga-FR") {
|
if (source.name == "Manga-FR") {
|
||||||
images.add("${sourceInfo.baseUrl}/uploads/manga/${slug}.jpg");
|
images.add("${source.baseUrl}/uploads/manga/${slug}.jpg");
|
||||||
} else {
|
} else {
|
||||||
images.add(
|
images.add(
|
||||||
"${sourceInfo.baseUrl}/uploads/manga/${slug}/cover/cover_250x350.jpg");
|
"${source.baseUrl}/uploads/manga/${slug}/cover/cover_250x350.jpg");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,22 +37,22 @@ class MMCRCms extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> getLatestUpdates(MSource sourceInfo, int page) async {
|
Future<MPages> getLatestUpdates(MSource source, int page) async {
|
||||||
final url = "${sourceInfo.baseUrl}/latest-release?page=$page";
|
final url = "${source.baseUrl}/latest-release?page=$page";
|
||||||
final data = {"url": url, "sourceId": sourceInfo.id};
|
final data = {"url": url, "sourceId": source.id};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
|
|
||||||
List<MManga> mangaList = [];
|
List<MManga> mangaList = [];
|
||||||
final urls = MBridge.xpath(res, '//*[@class="manga-item"]/h3/a/@href');
|
final urls = xpath(res, '//*[@class="manga-item"]/h3/a/@href');
|
||||||
final names = MBridge.xpath(res, '//*[@class="manga-item"]/h3/a/text()');
|
final names = xpath(res, '//*[@class="manga-item"]/h3/a/text()');
|
||||||
List<String> images = [];
|
List<String> images = [];
|
||||||
for (var url in urls) {
|
for (var url in urls) {
|
||||||
String slug = MBridge.substringAfterLast(url, '/');
|
String slug = substringAfterLast(url, '/');
|
||||||
if (sourceInfo.name == "Manga-FR") {
|
if (source.name == "Manga-FR") {
|
||||||
images.add("${sourceInfo.baseUrl}/uploads/manga/${slug}.jpg");
|
images.add("${source.baseUrl}/uploads/manga/${slug}.jpg");
|
||||||
} else {
|
} else {
|
||||||
images.add(
|
images.add(
|
||||||
"${sourceInfo.baseUrl}/uploads/manga/${slug}/cover/cover_250x350.jpg");
|
"${source.baseUrl}/uploads/manga/${slug}/cover/cover_250x350.jpg");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,10 +68,10 @@ class MMCRCms extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> search(MSource sourceInfo, String query, int page) async {
|
Future<MPages> search(MSource source, String query, int page) async {
|
||||||
final url = "${sourceInfo.baseUrl}/search?query=$query";
|
final url = "${source.baseUrl}/search?query=$query";
|
||||||
final data = {"url": url, "sourceId": sourceInfo.id};
|
final data = {"url": url, "sourceId": source.id};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
|
|
||||||
List<MManga> mangaList = [];
|
List<MManga> mangaList = [];
|
||||||
final jsonList = json.decode(res)["suggestions"];
|
final jsonList = json.decode(res)["suggestions"];
|
||||||
@@ -81,19 +81,19 @@ class MMCRCms extends MSourceProvider {
|
|||||||
for (var da in jsonList) {
|
for (var da in jsonList) {
|
||||||
String value = da["value"];
|
String value = da["value"];
|
||||||
String data = da["data"];
|
String data = da["data"];
|
||||||
if (sourceInfo.name == 'Scan VF') {
|
if (source.name == 'Scan VF') {
|
||||||
urls.add('${sourceInfo.baseUrl}/$data');
|
urls.add('${source.baseUrl}/$data');
|
||||||
} else if (sourceInfo.name == 'Manga-FR') {
|
} else if (source.name == 'Manga-FR') {
|
||||||
urls.add('${sourceInfo.baseUrl}/lecture-en-ligne/$data');
|
urls.add('${source.baseUrl}/lecture-en-ligne/$data');
|
||||||
} else {
|
} else {
|
||||||
urls.add('${sourceInfo.baseUrl}/manga/$data');
|
urls.add('${source.baseUrl}/manga/$data');
|
||||||
}
|
}
|
||||||
names.add(value);
|
names.add(value);
|
||||||
if (sourceInfo.name == "Manga-FR") {
|
if (source.name == "Manga-FR") {
|
||||||
images.add("${sourceInfo.baseUrl}/uploads/manga/$data.jpg");
|
images.add("${source.baseUrl}/uploads/manga/$data.jpg");
|
||||||
} else {
|
} else {
|
||||||
images.add(
|
images.add(
|
||||||
"${sourceInfo.baseUrl}/uploads/manga/$data/cover/cover_250x350.jpg");
|
"${source.baseUrl}/uploads/manga/$data/cover/cover_250x350.jpg");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,7 +109,7 @@ class MMCRCms extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MManga> getDetail(MSource sourceInfo, String url) async {
|
Future<MManga> getDetail(MSource source, String url) async {
|
||||||
final statusList = [
|
final statusList = [
|
||||||
{
|
{
|
||||||
"complete": 1,
|
"complete": 1,
|
||||||
@@ -128,23 +128,23 @@ class MMCRCms extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
MManga manga = MManga();
|
MManga manga = MManga();
|
||||||
final datas = {"url": url, "sourceId": sourceInfo.id};
|
final datas = {"url": url, "sourceId": source.id};
|
||||||
final res = await MBridge.http('GET', json.encode(datas));
|
final res = await http('GET', json.encode(datas));
|
||||||
|
|
||||||
manga.author = MBridge.xpath(res,
|
manga.author = xpath(res,
|
||||||
'//*[@class="dl-horizontal"]/dt[contains(text(), "Auteur(s)") or contains(text(), "Author(s)") or contains(text(), "Autor(es)") or contains(text(), "Yazar(lar) or contains(text(), "Mangaka(lar)")]//following-sibling::dd[1]/text()')
|
'//*[@class="dl-horizontal"]/dt[contains(text(), "Auteur(s)") or contains(text(), "Author(s)") or contains(text(), "Autor(es)") or contains(text(), "Yazar(lar) or contains(text(), "Mangaka(lar)")]//following-sibling::dd[1]/text()')
|
||||||
.first;
|
.first;
|
||||||
final status = MBridge.xpath(res,
|
final status = xpath(res,
|
||||||
'//*[@class="dl-horizontal"]/dt[contains(text(), "Statut") or contains(text(), "Status") or contains(text(), "Estado") or contains(text(), "Durum")]/following-sibling::dd[1]/text()')
|
'//*[@class="dl-horizontal"]/dt[contains(text(), "Statut") or contains(text(), "Status") or contains(text(), "Estado") or contains(text(), "Durum")]/following-sibling::dd[1]/text()')
|
||||||
.first;
|
.first;
|
||||||
manga.status = MBridge.parseStatus(status, statusList);
|
manga.status = parseStatus(status, statusList);
|
||||||
manga.description =
|
manga.description =
|
||||||
MBridge.xpath(res, '//*[@class="well" or @class="manga well"]/p/text()')
|
xpath(res, '//*[@class="well" or @class="manga well"]/p/text()')
|
||||||
.first;
|
.first;
|
||||||
manga.genre = MBridge.xpath(res,
|
manga.genre = xpath(res,
|
||||||
'//*[@class="dl-horizontal"]/dt[contains(text(), "Categories") or contains(text(), "Categorias") or contains(text(), "Categorías") or contains(text(), "Catégories") or contains(text(), "Kategoriler" or contains(text(), "Kategorie") or contains(text(), "Kategori") or contains(text(), "Tagi"))]/following-sibling::dd[1]/text()');
|
'//*[@class="dl-horizontal"]/dt[contains(text(), "Categories") or contains(text(), "Categorias") or contains(text(), "Categorías") or contains(text(), "Catégories") or contains(text(), "Kategoriler" or contains(text(), "Kategorie") or contains(text(), "Kategori") or contains(text(), "Tagi"))]/following-sibling::dd[1]/text()');
|
||||||
|
|
||||||
final baseUrl = "${sourceInfo.baseUrl}/";
|
final baseUrl = "${source.baseUrl}/";
|
||||||
final headers = {
|
final headers = {
|
||||||
"Referer": baseUrl,
|
"Referer": baseUrl,
|
||||||
"Content-Type": "application/x-www-form-urlencoded",
|
"Content-Type": "application/x-www-form-urlencoded",
|
||||||
@@ -152,14 +152,14 @@ class MMCRCms extends MSourceProvider {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var chapUrls =
|
var chapUrls =
|
||||||
MBridge.xpath(res, '//*[@class="chapter-title-rtl"]/a/@href');
|
xpath(res, '//*[@class="chapter-title-rtl"]/a/@href');
|
||||||
var chaptersNames =
|
var chaptersNames =
|
||||||
MBridge.xpath(res, '//*[@class="chapter-title-rtl"]/a/text()');
|
xpath(res, '//*[@class="chapter-title-rtl"]/a/text()');
|
||||||
var chaptersDates =
|
var chaptersDates =
|
||||||
MBridge.xpath(res, '//*[@class="date-chapter-title-rtl"]/text()');
|
xpath(res, '//*[@class="date-chapter-title-rtl"]/text()');
|
||||||
|
|
||||||
var dateUploads = MBridge.parseDates(
|
var dateUploads = parseDates(
|
||||||
chaptersDates, sourceInfo.dateFormat, sourceInfo.dateFormatLocale);
|
chaptersDates, source.dateFormat, source.dateFormatLocale);
|
||||||
|
|
||||||
List<MChapter>? chaptersList = [];
|
List<MChapter>? chaptersList = [];
|
||||||
for (var i = 0; i < chaptersNames.length; i++) {
|
for (var i = 0; i < chaptersNames.length; i++) {
|
||||||
@@ -174,12 +174,12 @@ class MMCRCms extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<String>> getPageList(MSource sourceInfo, String url) async {
|
Future<List<String>> getPageList(MSource source, String url) async {
|
||||||
final datas = {"url": url, "sourceId": sourceInfo.id};
|
final datas = {"url": url, "sourceId": source.id};
|
||||||
final res = await MBridge.http('GET', json.encode(datas));
|
final res = await http('GET', json.encode(datas));
|
||||||
|
|
||||||
List<String> pagesUrl = [];
|
List<String> pagesUrl = [];
|
||||||
final pages = MBridge.xpath(
|
final pages = xpath(
|
||||||
res, '//*[@id="all"]/img[@class="img-responsive"]/@data-src');
|
res, '//*[@id="all"]/img[@class="img-responsive"]/@data-src');
|
||||||
for (var page in pages) {
|
for (var page in pages) {
|
||||||
if (page.startsWith('//')) {
|
if (page.startsWith('//')) {
|
||||||
@@ -193,7 +193,7 @@ class MMCRCms extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<MVideo>> getVideoList(MSource sourceInfo, String url) async {
|
Future<List<MVideo>> getVideoList(MSource source, String url) async {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,38 +1,38 @@
|
|||||||
import 'package:mangayomi/bridge_lib.dart';
|
import 'package:mangayomi/bridge_lib.dart';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
class NepNep extends MSourceProvider {
|
class NepNep extends MProvider {
|
||||||
NepNep();
|
NepNep();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> getPopular(MSource sourceInfo, int page) async {
|
Future<MPages> getPopular(MSource source, int page) async {
|
||||||
final data = {"url": "${sourceInfo.baseUrl}/search/"};
|
final data = {"url": "${source.baseUrl}/search/"};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
|
|
||||||
final directory = directoryFromDocument(res);
|
final directory = directoryFromDocument(res);
|
||||||
final resSort = MBridge.sortMapList(json.decode(directory), "vm", 1);
|
final resSort = sortMapList(json.decode(directory), "vm", 1);
|
||||||
|
|
||||||
return parseDirectory(resSort);
|
return parseDirectory(resSort);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> getLatestUpdates(MSource sourceInfo, int page) async {
|
Future<MPages> getLatestUpdates(MSource source, int page) async {
|
||||||
final data = {"url": "${sourceInfo.baseUrl}/search/"};
|
final data = {"url": "${source.baseUrl}/search/"};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
|
|
||||||
final directory = directoryFromDocument(res);
|
final directory = directoryFromDocument(res);
|
||||||
final resSort = MBridge.sortMapList(json.decode(directory), "lt", 1);
|
final resSort = sortMapList(json.decode(directory), "lt", 1);
|
||||||
|
|
||||||
return parseDirectory(resSort);
|
return parseDirectory(resSort);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@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/"};
|
final data = {"url": "${source.baseUrl}/search/"};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
|
|
||||||
final directory = directoryFromDocument(res);
|
final directory = directoryFromDocument(res);
|
||||||
final resSort = MBridge.sortMapList(json.decode(directory), "lt", 1);
|
final resSort = sortMapList(json.decode(directory), "lt", 1);
|
||||||
final datas = json.decode(resSort) as List;
|
final datas = json.decode(resSort) as List;
|
||||||
final queryRes = datas.where((e) {
|
final queryRes = datas.where((e) {
|
||||||
String name = e['s'];
|
String name = e['s'];
|
||||||
@@ -43,40 +43,36 @@ class NepNep extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MManga> getDetail(MSource sourceInfo, String url) async {
|
Future<MManga> getDetail(MSource source, String url) async {
|
||||||
final statusList = [
|
final statusList = [
|
||||||
{"Ongoing": 0, "Completed": 1, "Cancelled": 3, "Hiatus": 2}
|
{"Ongoing": 0, "Completed": 1, "Cancelled": 3, "Hiatus": 2}
|
||||||
];
|
];
|
||||||
final headers = getHeader(sourceInfo.baseUrl);
|
final headers = getHeader(source.baseUrl);
|
||||||
final data = {
|
final data = {"url": '${source.baseUrl}/manga/$url', "headers": headers};
|
||||||
"url": '${sourceInfo.baseUrl}/manga/$url',
|
final res = await http('GET', json.encode(data));
|
||||||
"headers": headers
|
|
||||||
};
|
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
|
||||||
MManga manga = MManga();
|
MManga manga = MManga();
|
||||||
manga.author = MBridge.xpath(res,
|
manga.author = xpath(res,
|
||||||
'//li[contains(@class,"list-group-item") and contains(text(),"Author")]/a/text()')
|
'//li[contains(@class,"list-group-item") and contains(text(),"Author")]/a/text()')
|
||||||
.first;
|
.first;
|
||||||
manga.description = MBridge.xpath(res,
|
manga.description = xpath(res,
|
||||||
'//li[contains(@class,"list-group-item") and contains(text(),"Description:")]/div/text()')
|
'//li[contains(@class,"list-group-item") and contains(text(),"Description:")]/div/text()')
|
||||||
.first;
|
.first;
|
||||||
final status = MBridge.xpath(res,
|
final status = xpath(res,
|
||||||
'//li[contains(@class,"list-group-item") and contains(text(),"Status")]/a/text()')
|
'//li[contains(@class,"list-group-item") and contains(text(),"Status")]/a/text()')
|
||||||
.first;
|
.first;
|
||||||
|
|
||||||
manga.status = MBridge.parseStatus(toStatus(status), statusList);
|
manga.status = parseStatus(toStatus(status), statusList);
|
||||||
manga.genre = MBridge.xpath(res,
|
manga.genre = xpath(res,
|
||||||
'//li[contains(@class,"list-group-item") and contains(text(),"Genre(s)")]/a/text()');
|
'//li[contains(@class,"list-group-item") and contains(text(),"Genre(s)")]/a/text()');
|
||||||
|
|
||||||
final script =
|
final script =
|
||||||
MBridge.xpath(res, '//script[contains(text(), "MainFunction")]/text()')
|
xpath(res, '//script[contains(text(), "MainFunction")]/text()').first;
|
||||||
.first;
|
final vmChapters =
|
||||||
final vmChapters = MBridge.substringBefore(
|
substringBefore(substringAfter(script, "vm.Chapters = "), ";");
|
||||||
MBridge.substringAfter(script, "vm.Chapters = "), ";");
|
|
||||||
final chapters = json.decode(vmChapters) as List;
|
final chapters = json.decode(vmChapters) as List;
|
||||||
var chapUrls = chapters
|
var chapUrls = chapters
|
||||||
.map((ch) =>
|
.map((ch) =>
|
||||||
'/read-online/${MBridge.substringAfter(url, "/manga/")}${chapterURLEncode(ch['Chapter'])}')
|
'/read-online/${substringAfter(url, "/manga/")}${chapterURLEncode(ch['Chapter'])}')
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
var chaptersNames = chapters.map((ch) {
|
var chaptersNames = chapters.map((ch) {
|
||||||
@@ -88,8 +84,8 @@ class NepNep extends MSourceProvider {
|
|||||||
return name;
|
return name;
|
||||||
}).toList();
|
}).toList();
|
||||||
var chaptersDates = chapters.map((ch) => ch['Date']).toList();
|
var chaptersDates = chapters.map((ch) => ch['Date']).toList();
|
||||||
var dateUploads = MBridge.parseDates(
|
var dateUploads =
|
||||||
chaptersDates, sourceInfo.dateFormat, sourceInfo.dateFormatLocale);
|
parseDates(chaptersDates, source.dateFormat, source.dateFormatLocale);
|
||||||
List<MChapter> chaptersList = [];
|
List<MChapter> chaptersList = [];
|
||||||
|
|
||||||
for (var ch in chapters) {
|
for (var ch in chapters) {
|
||||||
@@ -101,10 +97,10 @@ class NepNep extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
chapter.name = name;
|
chapter.name = name;
|
||||||
chapter.url =
|
chapter.url =
|
||||||
'/read-online/${MBridge.substringAfter(url, "/manga/")}${chapterURLEncode(ch['Chapter'])}';
|
'/read-online/${substringAfter(url, "/manga/")}${chapterURLEncode(ch['Chapter'])}';
|
||||||
chapter.dateUpload = MBridge.parseDates(
|
chapter.dateUpload =
|
||||||
[ch['Date']], sourceInfo.dateFormat, sourceInfo.dateFormatLocale)
|
parseDates([ch['Date']], source.dateFormat, source.dateFormatLocale)
|
||||||
.first;
|
.first;
|
||||||
chaptersList.add(chapter);
|
chaptersList.add(chapter);
|
||||||
}
|
}
|
||||||
manga.chapters = chaptersList;
|
manga.chapters = chaptersList;
|
||||||
@@ -112,25 +108,24 @@ class NepNep extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<String>> getPageList(MSource sourceInfo, String url) async {
|
Future<List<String>> getPageList(MSource source, String url) async {
|
||||||
final headers = getHeader(sourceInfo.baseUrl);
|
final headers = getHeader(source.baseUrl);
|
||||||
List<String> pages = [];
|
List<String> pages = [];
|
||||||
final data = {"url": '${sourceInfo.baseUrl}$url', "headers": headers};
|
final data = {"url": '${source.baseUrl}$url', "headers": headers};
|
||||||
print(data);
|
print(data);
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
final script =
|
final script =
|
||||||
MBridge.xpath(res, '//script[contains(text(), "MainFunction")]/text()')
|
xpath(res, '//script[contains(text(), "MainFunction")]/text()').first;
|
||||||
.first;
|
final chapScript = json.decode(
|
||||||
final chapScript = json.decode(MBridge.substringBefore(
|
substringBefore(substringAfter(script, "vm.CurChapter = "), ";"));
|
||||||
MBridge.substringAfter(script, "vm.CurChapter = "), ";"));
|
final pathName = substringBefore(
|
||||||
final pathName = MBridge.substringBefore(
|
substringAfter(script, "vm.CurPathName = \"", ""), "\"");
|
||||||
MBridge.substringAfter(script, "vm.CurPathName = \"", ""), "\"");
|
|
||||||
var directory = chapScript['Directory'] ?? '';
|
var directory = chapScript['Directory'] ?? '';
|
||||||
if (directory.length > 0) {
|
if (directory.length > 0) {
|
||||||
directory += '/';
|
directory += '/';
|
||||||
}
|
}
|
||||||
final mangaName = MBridge.substringBefore(
|
final mangaName =
|
||||||
MBridge.substringAfter(url, "/read-online/"), "-chapter");
|
substringBefore(substringAfter(url, "/read-online/"), "-chapter");
|
||||||
var chNum = chapterImage(chapScript['Chapter'], false);
|
var chNum = chapterImage(chapScript['Chapter'], false);
|
||||||
var totalPages = int.parse(chapScript['Page']);
|
var totalPages = int.parse(chapScript['Page']);
|
||||||
for (int page = 1; page <= totalPages; page++) {
|
for (int page = 1; page <= totalPages; page++) {
|
||||||
@@ -145,10 +140,9 @@ class NepNep extends MSourceProvider {
|
|||||||
|
|
||||||
String directoryFromDocument(String res) {
|
String directoryFromDocument(String res) {
|
||||||
final script =
|
final script =
|
||||||
MBridge.xpath(res, '//script[contains(text(), "MainFunction")]/text()')
|
xpath(res, '//script[contains(text(), "MainFunction")]/text()').first;
|
||||||
.first;
|
return substringBefore(
|
||||||
return MBridge.substringBefore(
|
substringAfter(script, "vm.Directory = "), "vm.GetIntValue")
|
||||||
MBridge.substringAfter(script, "vm.Directory = "), "vm.GetIntValue")
|
|
||||||
.replaceAll(";", " ");
|
.replaceAll(";", " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,19 +159,10 @@ class NepNep extends MSourceProvider {
|
|||||||
return MPages(mangaList, true);
|
return MPages(mangaList, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, String> getHeader(String url) {
|
|
||||||
final headers = {
|
|
||||||
'Referer': '$url/',
|
|
||||||
"User-Agent":
|
|
||||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Firefox/77.0"
|
|
||||||
};
|
|
||||||
return headers;
|
|
||||||
}
|
|
||||||
|
|
||||||
String chapterImage(String e, bool cleanString) {
|
String chapterImage(String e, bool cleanString) {
|
||||||
var a = e.substring(1, e.length - 1);
|
var a = e.substring(1, e.length - 1);
|
||||||
if (cleanString) {
|
if (cleanString) {
|
||||||
a = MBridge.regExp(a, r'^0+', "", 0, 0);
|
a = regExp(a, r'^0+', "", 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
var b = int.parse(e.substring(e.length - 1));
|
var b = int.parse(e.substring(e.length - 1));
|
||||||
@@ -236,11 +221,20 @@ class NepNep extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<MVideo>> getVideoList(MSource sourceInfo, String url) async {
|
Future<List<MVideo>> getVideoList(MSource source, String url) async {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Map<String, String> getHeader(String url) {
|
||||||
|
final headers = {
|
||||||
|
'Referer': '$url/',
|
||||||
|
"User-Agent":
|
||||||
|
"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Firefox/77.0"
|
||||||
|
};
|
||||||
|
return headers;
|
||||||
|
}
|
||||||
|
|
||||||
NepNep main() {
|
NepNep main() {
|
||||||
return NepNep();
|
return NepNep();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,61 +1,59 @@
|
|||||||
import 'package:mangayomi/bridge_lib.dart';
|
import 'package:mangayomi/bridge_lib.dart';
|
||||||
import 'package:mangayomi/utils.dart';
|
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
class Batoto extends MSourceProvider {
|
class Batoto extends MProvider {
|
||||||
Batoto();
|
Batoto();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> getPopular(MSource sourceInfo, int page) async {
|
Future<MPages> getPopular(MSource source, int page) async {
|
||||||
final url =
|
final url =
|
||||||
"${sourceInfo.baseUrl}/browse?${lang(sourceInfo.lang)}&sort=views_a&page=$page";
|
"${source.baseUrl}/browse?${lang(source.lang)}&sort=views_a&page=$page";
|
||||||
final data = {"url": url};
|
final data = {"url": url};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
return mangaElementM(res, sourceInfo);
|
return mangaElementM(res, source);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> getLatestUpdates(MSource sourceInfo, int page) async {
|
Future<MPages> getLatestUpdates(MSource source, int page) async {
|
||||||
final url =
|
final url =
|
||||||
"${sourceInfo.baseUrl}/browse?${lang(sourceInfo.lang)}&sort=update&page=$page";
|
"${source.baseUrl}/browse?${lang(source.lang)}&sort=update&page=$page";
|
||||||
final data = {"url": url};
|
final data = {"url": url};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
return mangaElementM(res, sourceInfo);
|
return mangaElementM(res, source);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> search(MSource sourceInfo, String query, int page) async {
|
Future<MPages> search(MSource source, String query, int page) async {
|
||||||
final url = "${sourceInfo.baseUrl}/search?word=$query&page=$page";
|
final url = "${source.baseUrl}/search?word=$query&page=$page";
|
||||||
final data = {"url": url};
|
final data = {"url": url};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
return mangaElementM(res, sourceInfo);
|
return mangaElementM(res, source);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MManga> getDetail(MSource sourceInfo, String url) async {
|
Future<MManga> getDetail(MSource source, String url) async {
|
||||||
final statusList = [
|
final statusList = [
|
||||||
{"Ongoing": 0, "Completed": 1, "Cancelled": 3, "Hiatus": 2}
|
{"Ongoing": 0, "Completed": 1, "Cancelled": 3, "Hiatus": 2}
|
||||||
];
|
];
|
||||||
|
|
||||||
final data = {"url": "${sourceInfo.baseUrl}$url"};
|
final data = {"url": "${source.baseUrl}$url"};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
MManga manga = MManga();
|
MManga manga = MManga();
|
||||||
final workStatus = MBridge.xpath(res,
|
final workStatus = xpath(res,
|
||||||
'//*[@class="attr-item"]/b[contains(text(),"Original work")]/following-sibling::span[1]/text()')
|
'//*[@class="attr-item"]/b[contains(text(),"Original work")]/following-sibling::span[1]/text()')
|
||||||
.first;
|
.first;
|
||||||
manga.status = MBridge.parseStatus(workStatus, statusList);
|
manga.status = parseStatus(workStatus, statusList);
|
||||||
|
|
||||||
manga.author = MBridge.xpath(res,
|
manga.author = xpath(res,
|
||||||
'//*[@class="attr-item"]/b[contains(text(),"Authors")]/following-sibling::span[1]/text()')
|
'//*[@class="attr-item"]/b[contains(text(),"Authors")]/following-sibling::span[1]/text()')
|
||||||
.first;
|
.first;
|
||||||
manga.genre = MBridge.xpath(res,
|
manga.genre = xpath(res,
|
||||||
'//*[@class="attr-item"]/b[contains(text(),"Genres")]/following-sibling::span[1]/text()')
|
'//*[@class="attr-item"]/b[contains(text(),"Genres")]/following-sibling::span[1]/text()')
|
||||||
.first
|
.first
|
||||||
.split(",");
|
.split(",");
|
||||||
manga.description =
|
manga.description = xpath(res, '//*[@class="limit-html"]/text()').first;
|
||||||
MBridge.xpath(res, '//*[@class="limit-html"]/text()').first;
|
|
||||||
|
|
||||||
List<String> chapsElement = MBridge.querySelectorAll(res,
|
List<String> chapsElement = querySelectorAll(res,
|
||||||
selector: "div.main div.p-2",
|
selector: "div.main div.p-2",
|
||||||
typeElement: 2,
|
typeElement: 2,
|
||||||
attributes: "",
|
attributes: "",
|
||||||
@@ -65,26 +63,24 @@ class Batoto extends MSourceProvider {
|
|||||||
List<String> chapsNames = [];
|
List<String> chapsNames = [];
|
||||||
List<String> scanlators = [];
|
List<String> scanlators = [];
|
||||||
for (var element in chapsElement) {
|
for (var element in chapsElement) {
|
||||||
final urlElement = MBridge.querySelectorAll(element,
|
final urlElement = querySelectorAll(element,
|
||||||
selector: "a.chapt",
|
selector: "a.chapt",
|
||||||
typeElement: 2,
|
typeElement: 2,
|
||||||
attributes: "",
|
attributes: "",
|
||||||
typeRegExp: 0)
|
typeRegExp: 0)
|
||||||
.first;
|
.first;
|
||||||
final group =
|
final group = xpath(element, '//*[@class="extra"]/a/text()').first;
|
||||||
MBridge.xpath(element, '//*[@class="extra"]/a/text()').first;
|
final name = xpath(urlElement, '//a/text()').first;
|
||||||
final name = MBridge.xpath(urlElement, '//a/text()').first;
|
final url = xpath(urlElement, '//a/@href').first;
|
||||||
final url = MBridge.xpath(urlElement, '//a/@href').first;
|
|
||||||
final time =
|
final time =
|
||||||
MBridge.xpath(element, '//*[@class="extra"]/i[@class="ps-3"]/text()')
|
xpath(element, '//*[@class="extra"]/i[@class="ps-3"]/text()').first;
|
||||||
.first;
|
|
||||||
times.add(time);
|
times.add(time);
|
||||||
chapsUrls.add(url);
|
chapsUrls.add(url);
|
||||||
scanlators.add(group);
|
scanlators.add(group);
|
||||||
chapsNames.add(name.replaceAll("\n ", "").replaceAll(" ", ""));
|
chapsNames.add(name.replaceAll("\n ", "").replaceAll(" ", ""));
|
||||||
}
|
}
|
||||||
var dateUploads = MBridge.parseDates(
|
var dateUploads =
|
||||||
times, sourceInfo.dateFormat, sourceInfo.dateFormatLocale);
|
parseDates(times, source.dateFormat, source.dateFormatLocale);
|
||||||
List<MChapter>? chaptersList = [];
|
List<MChapter>? chaptersList = [];
|
||||||
for (var i = 0; i < chapsNames.length; i++) {
|
for (var i = 0; i < chapsNames.length; i++) {
|
||||||
MChapter chapter = MChapter();
|
MChapter chapter = MChapter();
|
||||||
@@ -99,29 +95,23 @@ class Batoto extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<String>> getPageList(MSource sourceInfo, String url) async {
|
Future<List<String>> getPageList(MSource source, String url) async {
|
||||||
final datas = {"url": "${sourceInfo.baseUrl}$url"};
|
final datas = {"url": "${source.baseUrl}$url"};
|
||||||
final res = await MBridge.http('GET', json.encode(datas));
|
final res = await http('GET', json.encode(datas));
|
||||||
|
|
||||||
final script = MBridge.xpath(res,
|
final script = xpath(res,
|
||||||
'//script[contains(text(), "imgHttpLis") and contains(text(), "batoWord") and contains(text(), "batoPass")]/text()')
|
'//script[contains(text(), "imgHttpLis") and contains(text(), "batoWord") and contains(text(), "batoPass")]/text()')
|
||||||
.first;
|
.first;
|
||||||
final imgHttpLisString = Substring(script)
|
final imgHttpLisString =
|
||||||
.substringAfterLast('const imgHttpLis =')
|
substringBefore(substringAfterLast(script, 'const imgHttpLis ='), ';');
|
||||||
.substringBefore(';')
|
|
||||||
.text;
|
|
||||||
var imgHttpLis = json.decode(imgHttpLisString);
|
var imgHttpLis = json.decode(imgHttpLisString);
|
||||||
final batoWord = Substring(script)
|
final batoWord =
|
||||||
.substringAfterLast('const batoWord =')
|
substringBefore(substringAfterLast(script, 'const batoWord ='), ';');
|
||||||
.substringBefore(';')
|
final batoPass =
|
||||||
.text;
|
substringBefore(substringAfterLast(script, 'const batoPass ='), ';');
|
||||||
final batoPass = Substring(script)
|
final evaluatedPass = deobfuscateJsPassword(batoPass);
|
||||||
.substringAfterLast('const batoPass =')
|
|
||||||
.substringBefore(';')
|
|
||||||
.text;
|
|
||||||
final evaluatedPass = MBridge.deobfuscateJsPassword(batoPass);
|
|
||||||
final imgAccListString =
|
final imgAccListString =
|
||||||
MBridge.decryptAESCryptoJS(batoWord.replaceAll('"', ""), evaluatedPass);
|
decryptAESCryptoJS(batoWord.replaceAll('"', ""), evaluatedPass);
|
||||||
var imgAccList = json.decode(imgAccListString);
|
var imgAccList = json.decode(imgAccListString);
|
||||||
List<String> pagesUrl = [];
|
List<String> pagesUrl = [];
|
||||||
for (int i = 0; i < imgHttpLis.length; i++) {
|
for (int i = 0; i < imgHttpLis.length; i++) {
|
||||||
@@ -133,10 +123,10 @@ class Batoto extends MSourceProvider {
|
|||||||
return pagesUrl;
|
return pagesUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
MPages mangaElementM(String res, MSource sourceInfo) async {
|
MPages mangaElementM(String res, MSource source) async {
|
||||||
final lang = sourceInfo.lang.replaceAll("-", "_");
|
final lang = source.lang.replaceAll("-", "_");
|
||||||
|
|
||||||
var resB = MBridge.querySelectorAll(res,
|
var resB = querySelectorAll(res,
|
||||||
selector: "div#series-list div.col",
|
selector: "div#series-list div.col",
|
||||||
typeElement: 2,
|
typeElement: 2,
|
||||||
attributes: "",
|
attributes: "",
|
||||||
@@ -147,22 +137,22 @@ class Batoto extends MSourceProvider {
|
|||||||
List<String> names = [];
|
List<String> names = [];
|
||||||
|
|
||||||
for (var element in resB) {
|
for (var element in resB) {
|
||||||
if (sourceInfo.lang == "all" ||
|
if (source.lang == "all" ||
|
||||||
sourceInfo.lang == "en" && element.contains('no-flag') ||
|
source.lang == "en" && element.contains('no-flag') ||
|
||||||
element.contains('data-lang="$lang"')) {
|
element.contains('data-lang="$lang"')) {
|
||||||
final item = MBridge.querySelectorAll(element,
|
final item = querySelectorAll(element,
|
||||||
selector: "a.item-cover",
|
selector: "a.item-cover",
|
||||||
typeElement: 2,
|
typeElement: 2,
|
||||||
attributes: "",
|
attributes: "",
|
||||||
typeRegExp: 0)
|
typeRegExp: 0)
|
||||||
.first;
|
.first;
|
||||||
final img = MBridge.querySelectorAll(item,
|
final img = querySelectorAll(item,
|
||||||
selector: "img",
|
selector: "img",
|
||||||
typeElement: 3,
|
typeElement: 3,
|
||||||
attributes: "src",
|
attributes: "src",
|
||||||
typeRegExp: 0)
|
typeRegExp: 0)
|
||||||
.first;
|
.first;
|
||||||
final url = MBridge.querySelectorAll(item,
|
final url = querySelectorAll(item,
|
||||||
selector: "a",
|
selector: "a",
|
||||||
typeElement: 3,
|
typeElement: 3,
|
||||||
attributes: "href",
|
attributes: "href",
|
||||||
@@ -170,7 +160,7 @@ class Batoto extends MSourceProvider {
|
|||||||
.first;
|
.first;
|
||||||
images.add(img);
|
images.add(img);
|
||||||
urls.add(url);
|
urls.add(url);
|
||||||
final title = MBridge.querySelectorAll(element,
|
final title = querySelectorAll(element,
|
||||||
selector: "a.item-title",
|
selector: "a.item-title",
|
||||||
typeElement: 0,
|
typeElement: 0,
|
||||||
attributes: "",
|
attributes: "",
|
||||||
@@ -201,7 +191,7 @@ class Batoto extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<MVideo>> getVideoList(MSource sourceInfo, String url) async {
|
Future<List<MVideo>> getVideoList(MSource source, String url) async {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,94 +1,88 @@
|
|||||||
import 'package:mangayomi/bridge_lib.dart';
|
import 'package:mangayomi/bridge_lib.dart';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
class ComickFun extends MSourceProvider {
|
class ComickFun extends MProvider {
|
||||||
ComickFun();
|
ComickFun();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> getPopular(MSource sourceInfo, int page) async {
|
Future<MPages> getPopular(MSource source, int page) async {
|
||||||
final url =
|
final url =
|
||||||
"${sourceInfo.apiUrl}/v1.0/search?sort=follow&page=$page&tachiyomi=true";
|
"${source.apiUrl}/v1.0/search?sort=follow&page=$page&tachiyomi=true";
|
||||||
final data = {"url": url, "headers": getHeader(sourceInfo.baseUrl)};
|
final data = {"url": url, "headers": getHeader(source.baseUrl)};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
return mangaRes(res);
|
return mangaRes(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> getLatestUpdates(MSource sourceInfo, int page) async {
|
Future<MPages> getLatestUpdates(MSource source, int page) async {
|
||||||
final url =
|
final url =
|
||||||
"${sourceInfo.apiUrl}/v1.0/search?sort=uploaded&page=$page&tachiyomi=true";
|
"${source.apiUrl}/v1.0/search?sort=uploaded&page=$page&tachiyomi=true";
|
||||||
final data = {"url": url, "headers": getHeader(sourceInfo.baseUrl)};
|
final data = {"url": url, "headers": getHeader(source.baseUrl)};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
return mangaRes(res);
|
return mangaRes(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> search(MSource sourceInfo, String query, int page) async {
|
Future<MPages> search(MSource source, String query, int page) async {
|
||||||
final url = "${sourceInfo.apiUrl}/v1.0/search?q=$query&tachiyomi=true";
|
final url = "${source.apiUrl}/v1.0/search?q=$query&tachiyomi=true";
|
||||||
final data = {"url": url, "headers": getHeader(sourceInfo.baseUrl)};
|
final data = {"url": url, "headers": getHeader(source.baseUrl)};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
return mangaRes(res);
|
return mangaRes(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MManga> getDetail(MSource sourceInfo, String url) async {
|
Future<MManga> getDetail(MSource source, String url) async {
|
||||||
final statusList = [
|
final statusList = [
|
||||||
{"1": 0, "2": 1, "3": 3, "4": 2}
|
{"1": 0, "2": 1, "3": 3, "4": 2}
|
||||||
];
|
];
|
||||||
|
|
||||||
final headers = getHeader(sourceInfo.baseUrl);
|
final headers = getHeader(source.baseUrl);
|
||||||
|
|
||||||
final urll =
|
final urll = "${source.apiUrl}${url.replaceAll("#", '')}?tachiyomi=true";
|
||||||
"${sourceInfo.apiUrl}${url.replaceAll("#", '')}?tachiyomi=true";
|
|
||||||
final data = {"url": urll, "headers": headers};
|
final data = {"url": urll, "headers": headers};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
MManga manga = MManga();
|
MManga manga = MManga();
|
||||||
manga.author = MBridge.jsonPathToString(res, r'$.authors[*].name', '');
|
manga.author = jsonPathToString(res, r'$.authors[*].name', '');
|
||||||
manga.genre =
|
manga.genre = jsonPathToString(res, r'$.genres[*].name', "_.").split("_.");
|
||||||
MBridge.jsonPathToString(res, r'$.genres[*].name', "_.").split("_.");
|
manga.description = jsonPathToString(res, r'$..desc', '');
|
||||||
manga.description = MBridge.jsonPathToString(res, r'$..desc', '');
|
manga.status =
|
||||||
manga.status = MBridge.parseStatus(
|
parseStatus(jsonPathToString(res, r'$..comic.status', ''), statusList);
|
||||||
MBridge.jsonPathToString(res, r'$..comic.status', ''), statusList);
|
|
||||||
final chapUrlReq =
|
final chapUrlReq =
|
||||||
"${sourceInfo.apiUrl}${url.replaceAll("#", '')}chapters?lang=${sourceInfo.lang}&tachiyomi=true&page=1";
|
"${source.apiUrl}${url.replaceAll("#", '')}chapters?lang=${source.lang}&tachiyomi=true&page=1";
|
||||||
final dataReq = {"url": chapUrlReq, "headers": headers};
|
final dataReq = {"url": chapUrlReq, "headers": headers};
|
||||||
final request = await MBridge.http('GET', json.encode(dataReq));
|
final request = await http('GET', json.encode(dataReq));
|
||||||
var total = MBridge.jsonPathToString(request, r'$.total', '');
|
var total = jsonPathToString(request, r'$.total', '');
|
||||||
final chapterLimit = int.parse(total);
|
final chapterLimit = int.parse(total);
|
||||||
final newChapUrlReq =
|
final newChapUrlReq =
|
||||||
"${sourceInfo.apiUrl}${url.replaceAll("#", '')}chapters?limit=$chapterLimit&lang=${sourceInfo.lang}&tachiyomi=true&page=1";
|
"${source.apiUrl}${url.replaceAll("#", '')}chapters?limit=$chapterLimit&lang=${source.lang}&tachiyomi=true&page=1";
|
||||||
|
|
||||||
final newDataReq = {"url": newChapUrlReq, "headers": headers};
|
final newDataReq = {"url": newChapUrlReq, "headers": headers};
|
||||||
final newRequest = await MBridge.http('GET', json.encode(newDataReq));
|
final newRequest = await http('GET', json.encode(newDataReq));
|
||||||
|
|
||||||
final chapsUrls =
|
final chapsUrls =
|
||||||
MBridge.jsonPathToString(newRequest, r'$.chapters[*].hid', "_.")
|
jsonPathToString(newRequest, r'$.chapters[*].hid', "_.").split("_.");
|
||||||
.split("_.");
|
|
||||||
final chapDate =
|
final chapDate =
|
||||||
MBridge.jsonPathToString(newRequest, r'$.chapters[*].created_at', "_.")
|
jsonPathToString(newRequest, r'$.chapters[*].created_at', "_.")
|
||||||
.split("_.");
|
.split("_.");
|
||||||
final chaptersVolumes =
|
final chaptersVolumes =
|
||||||
MBridge.jsonPathToString(newRequest, r'$.chapters[*].vol', "_.")
|
jsonPathToString(newRequest, r'$.chapters[*].vol', "_.").split("_.");
|
||||||
.split("_.");
|
|
||||||
final chaptersScanlators =
|
final chaptersScanlators =
|
||||||
MBridge.jsonPathToString(newRequest, r'$.chapters[*].group_name', "_.")
|
jsonPathToString(newRequest, r'$.chapters[*].group_name', "_.")
|
||||||
.split("_.");
|
.split("_.");
|
||||||
final chapsNames =
|
final chapsNames =
|
||||||
MBridge.jsonPathToString(newRequest, r'$.chapters[*].title', "_.")
|
jsonPathToString(newRequest, r'$.chapters[*].title', "_.").split("_.");
|
||||||
.split("_.");
|
|
||||||
final chaptersChaps =
|
final chaptersChaps =
|
||||||
MBridge.jsonPathToString(newRequest, r'$.chapters[*].chap', "_.")
|
jsonPathToString(newRequest, r'$.chapters[*].chap', "_.").split("_.");
|
||||||
.split("_.");
|
|
||||||
|
|
||||||
var dateUploads = MBridge.parseDates(
|
var dateUploads =
|
||||||
chapDate, sourceInfo.dateFormat, sourceInfo.dateFormatLocale);
|
parseDates(chapDate, source.dateFormat, source.dateFormatLocale);
|
||||||
List<MChapter>? chaptersList = [];
|
List<MChapter>? chaptersList = [];
|
||||||
for (var i = 0; i < chapsNames.length; i++) {
|
for (var i = 0; i < chapsNames.length; i++) {
|
||||||
String title = "";
|
String title = "";
|
||||||
String scanlator = "";
|
String scanlator = "";
|
||||||
if (chaptersChaps.isNotEmpty && chaptersVolumes.isNotEmpty) {
|
if (chaptersChaps.isNotEmpty && chaptersVolumes.isNotEmpty) {
|
||||||
title = beautifyChapterName(chaptersVolumes[i], chaptersChaps[i],
|
title = beautifyChapterName(
|
||||||
chapsNames[i], sourceInfo.lang);
|
chaptersVolumes[i], chaptersChaps[i], chapsNames[i], source.lang);
|
||||||
} else {
|
} else {
|
||||||
title = chapsNames[i];
|
title = chapsNames[i];
|
||||||
}
|
}
|
||||||
@@ -110,23 +104,22 @@ class ComickFun extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<String>> getPageList(MSource sourceInfo, String url) async {
|
Future<List<String>> getPageList(MSource source, String url) async {
|
||||||
final urll = "${sourceInfo.apiUrl}/chapter/$url?tachiyomi=true";
|
final urll = "${source.apiUrl}/chapter/$url?tachiyomi=true";
|
||||||
final data = {"url": urll, "headers": getHeader(url)};
|
final data = {"url": urll, "headers": getHeader(url)};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
return MBridge.jsonPathToString(res, r'$.chapter.images[*].url', '_.')
|
return jsonPathToString(res, r'$.chapter.images[*].url', '_.').split('_.');
|
||||||
.split('_.');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MPages mangaRes(String res) async {
|
MPages mangaRes(String res) async {
|
||||||
final names = MBridge.jsonPathToList(res, r'$.title', 0);
|
final names = jsonPathToList(res, r'$.title', 0);
|
||||||
List<String> ids = MBridge.jsonPathToList(res, r'$.hid', 0);
|
List<String> ids = jsonPathToList(res, r'$.hid', 0);
|
||||||
List<String> mangaUrls = [];
|
List<String> mangaUrls = [];
|
||||||
for (var id in ids) {
|
for (var id in ids) {
|
||||||
mangaUrls.add("/comic/$id/#");
|
mangaUrls.add("/comic/$id/#");
|
||||||
}
|
}
|
||||||
final urls = mangaUrls;
|
final urls = mangaUrls;
|
||||||
final images = MBridge.jsonPathToList(res, r'$.cover_url', 0);
|
final images = jsonPathToList(res, r'$.cover_url', 0);
|
||||||
List<MManga> mangaList = [];
|
List<MManga> mangaList = [];
|
||||||
for (var i = 0; i < urls.length; i++) {
|
for (var i = 0; i < urls.length; i++) {
|
||||||
MManga manga = MManga();
|
MManga manga = MManga();
|
||||||
@@ -139,15 +132,6 @@ class ComickFun extends MSourceProvider {
|
|||||||
return MPages(mangaList, true);
|
return MPages(mangaList, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, String> getHeader(String url) {
|
|
||||||
final headers = {
|
|
||||||
"Referer": "$url/",
|
|
||||||
'User-Agent':
|
|
||||||
"Tachiyomi Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:110.0) Gecko/20100101 Firefox/110.0"
|
|
||||||
};
|
|
||||||
return headers;
|
|
||||||
}
|
|
||||||
|
|
||||||
String beautifyChapterName(
|
String beautifyChapterName(
|
||||||
String vol, String chap, String title, String lang) {
|
String vol, String chap, String title, String lang) {
|
||||||
String result = "";
|
String result = "";
|
||||||
@@ -184,11 +168,20 @@ class ComickFun extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<MVideo>> getVideoList(MSource sourceInfo, String url) async {
|
Future<List<MVideo>> getVideoList(MSource source, String url) async {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Map<String, String> getHeader(String url) {
|
||||||
|
final headers = {
|
||||||
|
"Referer": "$url/",
|
||||||
|
'User-Agent':
|
||||||
|
"Tachiyomi Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:110.0) Gecko/20100101 Firefox/110.0"
|
||||||
|
};
|
||||||
|
return headers;
|
||||||
|
}
|
||||||
|
|
||||||
ComickFun main() {
|
ComickFun main() {
|
||||||
return ComickFun();
|
return ComickFun();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,28 +1,28 @@
|
|||||||
import 'package:mangayomi/bridge_lib.dart';
|
import 'package:mangayomi/bridge_lib.dart';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
class MangaDex extends MSourceProvider {
|
class MangaDex extends MProvider {
|
||||||
MangaDex();
|
MangaDex();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> getPopular(MSource sourceInfo, int page) async {
|
Future<MPages> getPopular(MSource source, int page) async {
|
||||||
page = (20 * (page - 1));
|
page = (20 * (page - 1));
|
||||||
final url =
|
final url =
|
||||||
"https://api.mangadex.org/manga?limit=20&offset=$page&availableTranslatedLanguage[]=en&includes[]=cover_art${getMDXContentRating()}&order[followedCount]=desc";
|
"https://api.mangadex.org/manga?limit=20&offset=$page&availableTranslatedLanguage[]=en&includes[]=cover_art${getMDXContentRating()}&order[followedCount]=desc";
|
||||||
final datas = {"url": url};
|
final datas = {"url": url};
|
||||||
final res = await MBridge.http('GET', json.encode(datas));
|
final res = await http('GET', json.encode(datas));
|
||||||
return mangaRes(res, sourceInfo);
|
return mangaRes(res, source);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> getLatestUpdates(MSource sourceInfo, int page) async {
|
Future<MPages> getLatestUpdates(MSource source, int page) async {
|
||||||
page = (20 * (page - 1));
|
page = (20 * (page - 1));
|
||||||
final urll =
|
final urll =
|
||||||
"https://api.mangadex.org/chapter?limit=20&offset=$page&translatedLanguage[]=${sourceInfo.lang}&includeFutureUpdates=0&order[publishAt]=desc&includeFuturePublishAt=0&includeEmptyPages=0";
|
"https://api.mangadex.org/chapter?limit=20&offset=$page&translatedLanguage[]=${source.lang}&includeFutureUpdates=0&order[publishAt]=desc&includeFuturePublishAt=0&includeEmptyPages=0";
|
||||||
final datas = {"url": urll};
|
final datas = {"url": urll};
|
||||||
final ress = await MBridge.http('GET', json.encode(datas));
|
final ress = await http('GET', json.encode(datas));
|
||||||
final mangaIds =
|
final mangaIds =
|
||||||
MBridge.jsonPathToString(ress, r'$.data[*].relationships[*].id', '.--')
|
jsonPathToString(ress, r'$.data[*].relationships[*].id', '.--')
|
||||||
.split('.--');
|
.split('.--');
|
||||||
String mangaIdss = "".toString();
|
String mangaIdss = "".toString();
|
||||||
for (var id in mangaIds) {
|
for (var id in mangaIds) {
|
||||||
@@ -30,58 +30,58 @@ class MangaDex extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
final newUrl =
|
final newUrl =
|
||||||
"https://api.mangadex.org/manga?includes[]=cover_art&limit=${mangaIds.length}${getMDXContentRating()}$mangaIdss";
|
"https://api.mangadex.org/manga?includes[]=cover_art&limit=${mangaIds.length}${getMDXContentRating()}$mangaIdss";
|
||||||
final res = await MBridge.http('GET', json.encode({"url": newUrl}));
|
final res = await http('GET', json.encode({"url": newUrl}));
|
||||||
return mangaRes(res, sourceInfo);
|
return mangaRes(res, source);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> search(MSource sourceInfo, String query, int page) async {
|
Future<MPages> search(MSource source, String query, int page) async {
|
||||||
final url =
|
final url =
|
||||||
"https://api.mangadex.org/manga?includes[]=cover_art&offset=0&limit=20&title=$query${getMDXContentRating()}&order[followedCount]=desc&availableTranslatedLanguage[]=${sourceInfo.lang}";
|
"https://api.mangadex.org/manga?includes[]=cover_art&offset=0&limit=20&title=$query${getMDXContentRating()}&order[followedCount]=desc&availableTranslatedLanguage[]=${source.lang}";
|
||||||
|
|
||||||
final res = await MBridge.http('GET', json.encode({"url": url}));
|
final res = await http('GET', json.encode({"url": url}));
|
||||||
return mangaRes(res, sourceInfo);
|
return mangaRes(res, source);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MManga> getDetail(MSource sourceInfo, String url) async {
|
Future<MManga> getDetail(MSource source, String url) async {
|
||||||
final statusList = [
|
final statusList = [
|
||||||
{"ongoing": 0, "completed": 1, "hiatus": 2, "cancelled": 3}
|
{"ongoing": 0, "completed": 1, "hiatus": 2, "cancelled": 3}
|
||||||
];
|
];
|
||||||
|
|
||||||
final urll =
|
final urll =
|
||||||
"https://api.mangadex.org$url?includes[]=cover_art&includes[]=author&includes[]=artist";
|
"https://api.mangadex.org$url?includes[]=cover_art&includes[]=author&includes[]=artist";
|
||||||
final res = await MBridge.http('GET', json.encode({"url": urll}));
|
final res = await http('GET', json.encode({"url": urll}));
|
||||||
MManga manga = MManga();
|
MManga manga = MManga();
|
||||||
manga.author = MBridge.jsonPathToString(
|
manga.author = jsonPathToString(
|
||||||
res, r'$..data.relationships[*].attributes.name', ', ');
|
res, r'$..data.relationships[*].attributes.name', ', ');
|
||||||
|
|
||||||
String expressionDescriptionA = r'$..data.attributes.description.en';
|
String expressionDescriptionA = r'$..data.attributes.description.en';
|
||||||
String expressionDescription = MBridge.regExp(
|
String expressionDescription = regExp(
|
||||||
r'$..data.attributes.description[a]',
|
r'$..data.attributes.description[a]',
|
||||||
r'\[a\]',
|
r'\[a\]',
|
||||||
".${sourceInfo.lang}",
|
".${source.lang}",
|
||||||
0,
|
0,
|
||||||
1);
|
1);
|
||||||
|
|
||||||
String description =
|
String description =
|
||||||
MBridge.jsonPathToString(res, expressionDescription, '');
|
jsonPathToString(res, expressionDescription, '');
|
||||||
if (description.isEmpty) {
|
if (description.isEmpty) {
|
||||||
description = MBridge.jsonPathToString(res, expressionDescriptionA, '');
|
description = jsonPathToString(res, expressionDescriptionA, '');
|
||||||
}
|
}
|
||||||
manga.description = description;
|
manga.description = description;
|
||||||
List<String> genres = [];
|
List<String> genres = [];
|
||||||
|
|
||||||
genres = MBridge.jsonPathToString(
|
genres = jsonPathToString(
|
||||||
res, r'$..data.attributes.tags[*].attributes.name.en', '.-')
|
res, r'$..data.attributes.tags[*].attributes.name.en', '.-')
|
||||||
.split('.-');
|
.split('.-');
|
||||||
|
|
||||||
String contentRating =
|
String contentRating =
|
||||||
MBridge.jsonPathToString(res, r'$..data.attributes.contentRating', '');
|
jsonPathToString(res, r'$..data.attributes.contentRating', '');
|
||||||
if (contentRating != "safe") {
|
if (contentRating != "safe") {
|
||||||
genres.add(contentRating);
|
genres.add(contentRating);
|
||||||
}
|
}
|
||||||
String publicationDemographic = MBridge.jsonPathToString(
|
String publicationDemographic = jsonPathToString(
|
||||||
res, r'$..data.attributes.publicationDemographic', '');
|
res, r'$..data.attributes.publicationDemographic', '');
|
||||||
if (publicationDemographic == "null") {
|
if (publicationDemographic == "null") {
|
||||||
} else {
|
} else {
|
||||||
@@ -89,21 +89,21 @@ class MangaDex extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
manga.genre = genres;
|
manga.genre = genres;
|
||||||
String statusRes =
|
String statusRes =
|
||||||
MBridge.jsonPathToString(res, r'$..data.attributes.status', '');
|
jsonPathToString(res, r'$..data.attributes.status', '');
|
||||||
manga.status = MBridge.parseStatus(statusRes, statusList);
|
manga.status = parseStatus(statusRes, statusList);
|
||||||
final mangaId = url.split('/').last;
|
final mangaId = url.split('/').last;
|
||||||
|
|
||||||
final paginatedChapterList =
|
final paginatedChapterList =
|
||||||
await paginatedChapterListRequest(mangaId, 0, sourceInfo.lang);
|
await paginatedChapterListRequest(mangaId, 0, source.lang);
|
||||||
final chapterList =
|
final chapterList =
|
||||||
MBridge.jsonPathToString(paginatedChapterList, r'$.data[*]', '_.')
|
jsonPathToString(paginatedChapterList, r'$.data[*]', '_.')
|
||||||
.split('_.');
|
.split('_.');
|
||||||
int limit = int.parse(
|
int limit = int.parse(
|
||||||
MBridge.jsonPathToString(paginatedChapterList, r'$.limit', ''));
|
jsonPathToString(paginatedChapterList, r'$.limit', ''));
|
||||||
int offset = int.parse(
|
int offset = int.parse(
|
||||||
MBridge.jsonPathToString(paginatedChapterList, r'$.offset', ''));
|
jsonPathToString(paginatedChapterList, r'$.offset', ''));
|
||||||
int total = int.parse(
|
int total = int.parse(
|
||||||
MBridge.jsonPathToString(paginatedChapterList, r'$.total', ''));
|
jsonPathToString(paginatedChapterList, r'$.total', ''));
|
||||||
List<MChapter> chapterListA = [];
|
List<MChapter> chapterListA = [];
|
||||||
|
|
||||||
final list =
|
final list =
|
||||||
@@ -114,11 +114,11 @@ class MangaDex extends MSourceProvider {
|
|||||||
while (hasMoreResults) {
|
while (hasMoreResults) {
|
||||||
offset += limit;
|
offset += limit;
|
||||||
var newRequest =
|
var newRequest =
|
||||||
await paginatedChapterListRequest(mangaId, offset, sourceInfo.lang);
|
await paginatedChapterListRequest(mangaId, offset, source.lang);
|
||||||
int total =
|
int total =
|
||||||
int.parse(MBridge.jsonPathToString(newRequest, r'$.total', ''));
|
int.parse(jsonPathToString(newRequest, r'$.total', ''));
|
||||||
final chapterList =
|
final chapterList =
|
||||||
MBridge.jsonPathToString(paginatedChapterList, r'$.data[*]', '_.')
|
jsonPathToString(paginatedChapterList, r'$.data[*]', '_.')
|
||||||
.split('_.');
|
.split('_.');
|
||||||
final list = getChapters(int.parse("${chapterList.length}"), newRequest);
|
final list = getChapters(int.parse("${chapterList.length}"), newRequest);
|
||||||
chapterListA.addAll(list);
|
chapterListA.addAll(list);
|
||||||
@@ -130,10 +130,10 @@ class MangaDex extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<String>> getPageList(MSource sourceInfo, String url) async {
|
Future<List<String>> getPageList(MSource source, String url) async {
|
||||||
final urll = "https://api.mangadex.org/at-home/server/$url";
|
final urll = "https://api.mangadex.org/at-home/server/$url";
|
||||||
|
|
||||||
final res = await MBridge.http('GET', json.encode({"url": urll}));
|
final res = await http('GET', json.encode({"url": urll}));
|
||||||
|
|
||||||
final dataRes = json.decode(res);
|
final dataRes = json.decode(res);
|
||||||
final host = dataRes["baseUrl"];
|
final host = dataRes["baseUrl"];
|
||||||
@@ -142,13 +142,13 @@ class MangaDex extends MSourceProvider {
|
|||||||
return chapterDatas.map((e) => "$host/data/$hash/$e").toList();
|
return chapterDatas.map((e) => "$host/data/$hash/$e").toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
MPages mangaRes(String res, MSource sourceInfo) {
|
MPages mangaRes(String res, MSource source) {
|
||||||
final datasRes = json.decode(res);
|
final datasRes = json.decode(res);
|
||||||
final resJson = datasRes["data"] as List;
|
final resJson = datasRes["data"] as List;
|
||||||
List<MManga> mangaList = [];
|
List<MManga> mangaList = [];
|
||||||
for (var e in resJson) {
|
for (var e in resJson) {
|
||||||
MManga manga = MManga();
|
MManga manga = MManga();
|
||||||
manga.name = findTitle(e, sourceInfo.lang);
|
manga.name = findTitle(e, source.lang);
|
||||||
manga.imageUrl = getCover(e);
|
manga.imageUrl = getCover(e);
|
||||||
manga.link = "/manga/${e["id"]}";
|
manga.link = "/manga/${e["id"]}";
|
||||||
mangaList.add(manga);
|
mangaList.add(manga);
|
||||||
@@ -160,18 +160,18 @@ class MangaDex extends MSourceProvider {
|
|||||||
List<MChapter> chaptersList = [];
|
List<MChapter> chaptersList = [];
|
||||||
String paginatedChapterList = paginatedChapterListA.toString();
|
String paginatedChapterList = paginatedChapterListA.toString();
|
||||||
final dataList =
|
final dataList =
|
||||||
MBridge.jsonPathToList(paginatedChapterList, r'$.data[*]', 0);
|
jsonPathToList(paginatedChapterList, r'$.data[*]', 0);
|
||||||
for (var res in dataList) {
|
for (var res in dataList) {
|
||||||
String scan = "".toString();
|
String scan = "".toString();
|
||||||
final groups = MBridge.jsonPathToList(res,
|
final groups = jsonPathToList(res,
|
||||||
r'$.relationships[?@.id!="00e03853-1b96-4f41-9542-c71b8692033b"]', 0);
|
r'$.relationships[?@.id!="00e03853-1b96-4f41-9542-c71b8692033b"]', 0);
|
||||||
String chapName = "".toString();
|
String chapName = "".toString();
|
||||||
for (var element in groups) {
|
for (var element in groups) {
|
||||||
final data = MBridge.getMapValue(element, "attributes", encode: true);
|
final data = getMapValue(element, "attributes", encode: true);
|
||||||
if (data.isNotEmpty) {
|
if (data.isNotEmpty) {
|
||||||
final name = MBridge.getMapValue(data, "name");
|
final name = getMapValue(data, "name");
|
||||||
scan += "$name".toString();
|
scan += "$name".toString();
|
||||||
final username = MBridge.getMapValue(data, "username");
|
final username = getMapValue(data, "username");
|
||||||
if (username.isNotEmpty) {
|
if (username.isNotEmpty) {
|
||||||
if (scan.isEmpty) {
|
if (scan.isEmpty) {
|
||||||
scan += "Uploaded by $username".toString();
|
scan += "Uploaded by $username".toString();
|
||||||
@@ -182,22 +182,22 @@ class MangaDex extends MSourceProvider {
|
|||||||
if (scan.isEmpty) {
|
if (scan.isEmpty) {
|
||||||
scan = "No Group".toString();
|
scan = "No Group".toString();
|
||||||
}
|
}
|
||||||
final dataRes = MBridge.getMapValue(res, "attributes", encode: true);
|
final dataRes = getMapValue(res, "attributes", encode: true);
|
||||||
if (dataRes.isNotEmpty) {
|
if (dataRes.isNotEmpty) {
|
||||||
final data = MBridge.getMapValue(res, "attributes", encode: true);
|
final data = getMapValue(res, "attributes", encode: true);
|
||||||
final volume = MBridge.getMapValue(data, "volume");
|
final volume = getMapValue(data, "volume");
|
||||||
if (volume.isNotEmpty) {
|
if (volume.isNotEmpty) {
|
||||||
if (volume != "null") {
|
if (volume != "null") {
|
||||||
chapName = "Vol.$volume ".toString();
|
chapName = "Vol.$volume ".toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final chapter = MBridge.getMapValue(data, "chapter");
|
final chapter = getMapValue(data, "chapter");
|
||||||
if (chapter.isNotEmpty) {
|
if (chapter.isNotEmpty) {
|
||||||
if (chapter != "null") {
|
if (chapter != "null") {
|
||||||
chapName += "Ch.$chapter ".toString();
|
chapName += "Ch.$chapter ".toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final title = MBridge.getMapValue(data, "title");
|
final title = getMapValue(data, "title");
|
||||||
if (title.isNotEmpty) {
|
if (title.isNotEmpty) {
|
||||||
if (title != "null") {
|
if (title != "null") {
|
||||||
if (chapName.isNotEmpty) {
|
if (chapName.isNotEmpty) {
|
||||||
@@ -209,13 +209,13 @@ class MangaDex extends MSourceProvider {
|
|||||||
if (chapName.isEmpty) {
|
if (chapName.isEmpty) {
|
||||||
chapName += "Oneshot".toString();
|
chapName += "Oneshot".toString();
|
||||||
}
|
}
|
||||||
final date = MBridge.getMapValue(data, "publishAt");
|
final date = getMapValue(data, "publishAt");
|
||||||
final id = MBridge.getMapValue(res, "id");
|
final id = getMapValue(res, "id");
|
||||||
MChapter chapterr = MChapter();
|
MChapter chapterr = MChapter();
|
||||||
chapterr.name = chapName;
|
chapterr.name = chapName;
|
||||||
chapterr.url = id;
|
chapterr.url = id;
|
||||||
chapterr.scanlator = scan;
|
chapterr.scanlator = scan;
|
||||||
chapterr.dateUpload = MBridge.parseDates(
|
chapterr.dateUpload = parseDates(
|
||||||
[date], "yyyy-MM-dd'T'HH:mm:ss+SSS", "en_US")
|
[date], "yyyy-MM-dd'T'HH:mm:ss+SSS", "en_US")
|
||||||
.first;
|
.first;
|
||||||
chaptersList.add(chapterr);
|
chaptersList.add(chapterr);
|
||||||
@@ -229,7 +229,7 @@ class MangaDex extends MSourceProvider {
|
|||||||
String mangaId, int offset, String lang) async {
|
String mangaId, int offset, String lang) async {
|
||||||
final url =
|
final url =
|
||||||
'https://api.mangadex.org/manga/$mangaId/feed?limit=500&offset=$offset&includes[]=user&includes[]=scanlation_group&order[volume]=desc&order[chapter]=desc&translatedLanguage[]=$lang&includeFuturePublishAt=0&includeEmptyPages=0${getMDXContentRating()}';
|
'https://api.mangadex.org/manga/$mangaId/feed?limit=500&offset=$offset&includes[]=user&includes[]=scanlation_group&order[volume]=desc&order[chapter]=desc&translatedLanguage[]=$lang&includeFuturePublishAt=0&includeEmptyPages=0${getMDXContentRating()}';
|
||||||
final res = await MBridge.http('GET', json.encode({"url": url}));
|
final res = await http('GET', json.encode({"url": url}));
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -242,10 +242,10 @@ class MangaDex extends MSourceProvider {
|
|||||||
String findTitle(Map<String, dynamic> dataRes, String lang) {
|
String findTitle(Map<String, dynamic> dataRes, String lang) {
|
||||||
final altTitlesJ = dataRes["attributes"]["altTitles"];
|
final altTitlesJ = dataRes["attributes"]["altTitles"];
|
||||||
final titleJ = dataRes["attributes"]["title"];
|
final titleJ = dataRes["attributes"]["title"];
|
||||||
final title = MBridge.getMapValue(json.encode(titleJ), "en");
|
final title = getMapValue(json.encode(titleJ), "en");
|
||||||
if (title.isEmpty) {
|
if (title.isEmpty) {
|
||||||
for (var r in altTitlesJ) {
|
for (var r in altTitlesJ) {
|
||||||
final altTitle = MBridge.getMapValue(json.encode(r), "en");
|
final altTitle = getMapValue(json.encode(r), "en");
|
||||||
if (altTitle.isNotEmpty) {
|
if (altTitle.isNotEmpty) {
|
||||||
return altTitle;
|
return altTitle;
|
||||||
}
|
}
|
||||||
@@ -270,7 +270,7 @@ class MangaDex extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<MVideo>> getVideoList(MSource sourceInfo, String url) async {
|
Future<List<MVideo>> getVideoList(MSource source, String url) async {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,23 +1,23 @@
|
|||||||
import 'package:mangayomi/bridge_lib.dart';
|
import 'package:mangayomi/bridge_lib.dart';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
class MangaHere extends MSourceProvider {
|
class MangaHere extends MProvider {
|
||||||
MangaHere();
|
MangaHere();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> getPopular(MSource sourceInfo, int page) async {
|
Future<MPages> getPopular(MSource source, int page) async {
|
||||||
final headers = getHeader(sourceInfo.baseUrl);
|
final headers = getHeader(source.baseUrl);
|
||||||
final url = "${sourceInfo.baseUrl}/directory/$page.htm";
|
final url = "${source.baseUrl}/directory/$page.htm";
|
||||||
|
|
||||||
final data = {"url": url, "headers": headers};
|
final data = {"url": url, "headers": headers};
|
||||||
final res = await MBridge.http('POST', json.encode(data));
|
final res = await http('POST', json.encode(data));
|
||||||
|
|
||||||
List<MManga> mangaList = [];
|
List<MManga> mangaList = [];
|
||||||
final names = MBridge.xpath(
|
final names = xpath(
|
||||||
res, '//*[ contains(@class, "manga-list-1-list")]/li/a/@title');
|
res, '//*[ contains(@class, "manga-list-1-list")]/li/a/@title');
|
||||||
final images = MBridge.xpath(res,
|
final images = xpath(res,
|
||||||
'//*[ contains(@class, "manga-list-1-list")]/li/a/img[@class="manga-list-1-cover"]/@src');
|
'//*[ contains(@class, "manga-list-1-list")]/li/a/img[@class="manga-list-1-cover"]/@src');
|
||||||
final urls = MBridge.xpath(
|
final urls = xpath(
|
||||||
res, '//*[ contains(@class, "manga-list-1-list")]/li/a/@href');
|
res, '//*[ contains(@class, "manga-list-1-list")]/li/a/@href');
|
||||||
|
|
||||||
for (var i = 0; i < names.length; i++) {
|
for (var i = 0; i < names.length; i++) {
|
||||||
@@ -32,19 +32,19 @@ class MangaHere extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> getLatestUpdates(MSource sourceInfo, int page) async {
|
Future<MPages> getLatestUpdates(MSource source, int page) async {
|
||||||
final headers = getHeader(sourceInfo.baseUrl);
|
final headers = getHeader(source.baseUrl);
|
||||||
final url = "${sourceInfo.baseUrl}/directory/$page.htm?latest";
|
final url = "${source.baseUrl}/directory/$page.htm?latest";
|
||||||
|
|
||||||
final data = {"url": url, "headers": headers};
|
final data = {"url": url, "headers": headers};
|
||||||
final res = await MBridge.http('POST', json.encode(data));
|
final res = await http('POST', json.encode(data));
|
||||||
|
|
||||||
List<MManga> mangaList = [];
|
List<MManga> mangaList = [];
|
||||||
final names = MBridge.xpath(
|
final names = xpath(
|
||||||
res, '//*[ contains(@class, "manga-list-1-list")]/li/a/@title');
|
res, '//*[ contains(@class, "manga-list-1-list")]/li/a/@title');
|
||||||
final images = MBridge.xpath(res,
|
final images = xpath(res,
|
||||||
'//*[ contains(@class, "manga-list-1-list")]/li/a/img[@class="manga-list-1-cover"]/@src');
|
'//*[ contains(@class, "manga-list-1-list")]/li/a/img[@class="manga-list-1-cover"]/@src');
|
||||||
final urls = MBridge.xpath(
|
final urls = xpath(
|
||||||
res, '//*[ contains(@class, "manga-list-1-list")]/li/a/@href');
|
res, '//*[ contains(@class, "manga-list-1-list")]/li/a/@href');
|
||||||
|
|
||||||
for (var i = 0; i < names.length; i++) {
|
for (var i = 0; i < names.length; i++) {
|
||||||
@@ -59,19 +59,19 @@ class MangaHere extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> search(MSource sourceInfo, String query, int page) async {
|
Future<MPages> search(MSource source, String query, int page) async {
|
||||||
final headers = getHeader(sourceInfo.baseUrl);
|
final headers = getHeader(source.baseUrl);
|
||||||
final url = "${sourceInfo.baseUrl}/search?title=$query&page=$page";
|
final url = "${source.baseUrl}/search?title=$query&page=$page";
|
||||||
|
|
||||||
final data = {"url": url, "headers": headers};
|
final data = {"url": url, "headers": headers};
|
||||||
final res = await MBridge.http('POST', json.encode(data));
|
final res = await http('POST', json.encode(data));
|
||||||
|
|
||||||
List<MManga> mangaList = [];
|
List<MManga> mangaList = [];
|
||||||
final names = MBridge.xpath(
|
final names = xpath(
|
||||||
res, '//*[contains(@class, "manga-list-4-list")]/li/a/@title');
|
res, '//*[contains(@class, "manga-list-4-list")]/li/a/@title');
|
||||||
final images = MBridge.xpath(res,
|
final images = xpath(res,
|
||||||
'//*[contains(@class, "manga-list-4-list")]/li/a/img[@class="manga-list-4-cover"]/@src');
|
'//*[contains(@class, "manga-list-4-list")]/li/a/img[@class="manga-list-4-cover"]/@src');
|
||||||
final urls = MBridge.xpath(
|
final urls = xpath(
|
||||||
res, '//*[contains(@class, "manga-list-4-list")]/li/a/@href');
|
res, '//*[contains(@class, "manga-list-4-list")]/li/a/@href');
|
||||||
|
|
||||||
for (var i = 0; i < names.length; i++) {
|
for (var i = 0; i < names.length; i++) {
|
||||||
@@ -86,34 +86,34 @@ class MangaHere extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MManga> getDetail(MSource sourceInfo, String url) async {
|
Future<MManga> getDetail(MSource source, String url) async {
|
||||||
final statusList = [
|
final statusList = [
|
||||||
{"Ongoing": 0, "Completed": 1}
|
{"Ongoing": 0, "Completed": 1}
|
||||||
];
|
];
|
||||||
final headers = getHeader(sourceInfo.baseUrl);
|
final headers = getHeader(source.baseUrl);
|
||||||
final data = {"url": "${sourceInfo.baseUrl}/$url", "headers": headers};
|
final data = {"url": "${source.baseUrl}/$url", "headers": headers};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
MManga manga = MManga();
|
MManga manga = MManga();
|
||||||
manga.author =
|
manga.author =
|
||||||
MBridge.xpath(res, '//*[@class="detail-info-right-say"]/a/text()')
|
xpath(res, '//*[@class="detail-info-right-say"]/a/text()')
|
||||||
.first;
|
.first;
|
||||||
manga.description =
|
manga.description =
|
||||||
MBridge.xpath(res, '//*[@class="fullcontent"]/text()').first;
|
xpath(res, '//*[@class="fullcontent"]/text()').first;
|
||||||
final status =
|
final status =
|
||||||
MBridge.xpath(res, '//*[@class="detail-info-right-title-tip"]/text()')
|
xpath(res, '//*[@class="detail-info-right-title-tip"]/text()')
|
||||||
.first;
|
.first;
|
||||||
manga.status = MBridge.parseStatus(status, statusList);
|
manga.status = parseStatus(status, statusList);
|
||||||
manga.genre =
|
manga.genre =
|
||||||
MBridge.xpath(res, '//*[@class="detail-info-right-tag-list"]/a/text()');
|
xpath(res, '//*[@class="detail-info-right-tag-list"]/a/text()');
|
||||||
|
|
||||||
var chapUrls =
|
var chapUrls =
|
||||||
MBridge.xpath(res, '//*[@class="detail-main-list"]/li/a/@href');
|
xpath(res, '//*[@class="detail-main-list"]/li/a/@href');
|
||||||
var chaptersNames = MBridge.xpath(res,
|
var chaptersNames = xpath(res,
|
||||||
'//*[@class="detail-main-list"]/li/a/div/p[@class="title3"]/text()');
|
'//*[@class="detail-main-list"]/li/a/div/p[@class="title3"]/text()');
|
||||||
final chapterDates = MBridge.xpath(res,
|
final chapterDates = xpath(res,
|
||||||
'//*[@class="detail-main-list"]/li/a/div/p[@class="title2"]/text()');
|
'//*[@class="detail-main-list"]/li/a/div/p[@class="title2"]/text()');
|
||||||
var dateUploads = MBridge.parseDates(
|
var dateUploads = parseDates(
|
||||||
chapterDates, sourceInfo.dateFormat, sourceInfo.dateFormatLocale);
|
chapterDates, source.dateFormat, source.dateFormatLocale);
|
||||||
|
|
||||||
List<MChapter>? chaptersList = [];
|
List<MChapter>? chaptersList = [];
|
||||||
for (var i = 0; i < chaptersNames.length; i++) {
|
for (var i = 0; i < chaptersNames.length; i++) {
|
||||||
@@ -128,19 +128,19 @@ class MangaHere extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<String>> getPageList(MSource sourceInfo, String url) async {
|
Future<List<String>> getPageList(MSource source, String url) async {
|
||||||
final headers = getHeader(sourceInfo.baseUrl);
|
final headers = getHeader(source.baseUrl);
|
||||||
final urll = "${sourceInfo.baseUrl}$url";
|
final urll = "${source.baseUrl}$url";
|
||||||
final data = {"url": urll, "headers": headers};
|
final data = {"url": urll, "headers": headers};
|
||||||
final res = await MBridge.http('GET', json.encode(data));
|
final res = await http('GET', json.encode(data));
|
||||||
final pages = MBridge.xpath(res, "//body/div/div/span/a/text()");
|
final pages = xpath(res, "//body/div/div/span/a/text()");
|
||||||
List<String> pageUrls = [];
|
List<String> pageUrls = [];
|
||||||
if (pages.isEmpty) {
|
if (pages.isEmpty) {
|
||||||
final script = MBridge.xpath(
|
final script = xpath(
|
||||||
res, "//script[contains(text(),'function(p,a,c,k,e,d)')]/text()")
|
res, "//script[contains(text(),'function(p,a,c,k,e,d)')]/text()")
|
||||||
.first
|
.first
|
||||||
.replaceAll("eval", "");
|
.replaceAll("eval", "");
|
||||||
String deobfuscatedScript = MBridge.evalJs(script);
|
String deobfuscatedScript = evalJs(script);
|
||||||
int a = deobfuscatedScript.indexOf("newImgs=['") + 10;
|
int a = deobfuscatedScript.indexOf("newImgs=['") + 10;
|
||||||
int b = deobfuscatedScript.indexOf("'];");
|
int b = deobfuscatedScript.indexOf("'];");
|
||||||
List<String> urls = deobfuscatedScript.substring(a, b).split("','");
|
List<String> urls = deobfuscatedScript.substring(a, b).split("','");
|
||||||
@@ -156,7 +156,7 @@ class MangaHere extends MSourceProvider {
|
|||||||
String secretKeyScript = res
|
String secretKeyScript = res
|
||||||
.substring(secretKeyScriptLocation, secretKeyScriptEndLocation)
|
.substring(secretKeyScriptLocation, secretKeyScriptEndLocation)
|
||||||
.replaceAll("eval", "");
|
.replaceAll("eval", "");
|
||||||
String secretKeyDeobfuscatedScript = MBridge.evalJs(secretKeyScript);
|
String secretKeyDeobfuscatedScript = evalJs(secretKeyScript);
|
||||||
int secretKeyStartLoc = secretKeyDeobfuscatedScript.indexOf("'");
|
int secretKeyStartLoc = secretKeyDeobfuscatedScript.indexOf("'");
|
||||||
int secretKeyEndLoc = secretKeyDeobfuscatedScript.indexOf(";");
|
int secretKeyEndLoc = secretKeyDeobfuscatedScript.indexOf(";");
|
||||||
|
|
||||||
@@ -181,7 +181,7 @@ class MangaHere extends MSourceProvider {
|
|||||||
"X-Requested-With": "XMLHttpRequest"
|
"X-Requested-With": "XMLHttpRequest"
|
||||||
};
|
};
|
||||||
final data = {"url": pageLink, "headers": headers};
|
final data = {"url": pageLink, "headers": headers};
|
||||||
final ress = await MBridge.http('GET', json.encode(data));
|
final ress = await http('GET', json.encode(data));
|
||||||
|
|
||||||
responseText = ress;
|
responseText = ress;
|
||||||
|
|
||||||
@@ -191,7 +191,7 @@ class MangaHere extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
String deobfuscatedScript =
|
String deobfuscatedScript =
|
||||||
MBridge.evalJs(responseText.replaceAll("eval", ""));
|
evalJs(responseText.replaceAll("eval", ""));
|
||||||
|
|
||||||
int baseLinkStartPos = deobfuscatedScript.indexOf("pix=") + 5;
|
int baseLinkStartPos = deobfuscatedScript.indexOf("pix=") + 5;
|
||||||
int baseLinkEndPos =
|
int baseLinkEndPos =
|
||||||
@@ -212,7 +212,7 @@ class MangaHere extends MSourceProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<List<MVideo>> getVideoList(MSource sourceInfo, String url) async {
|
Future<List<MVideo>> getVideoList(MSource source, String url) async {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user