|
|
|
@@ -109,12 +109,6 @@ class MangaReader extends MProvider {
|
|
|
|
"En emision": 0,
|
|
|
|
"En emision": 0,
|
|
|
|
"مستمر": 0,
|
|
|
|
"مستمر": 0,
|
|
|
|
"ยังไม่จบ": 0,
|
|
|
|
"ยังไม่จบ": 0,
|
|
|
|
"curso": 0,
|
|
|
|
|
|
|
|
"en marcha": 0,
|
|
|
|
|
|
|
|
"publicandose": 0,
|
|
|
|
|
|
|
|
"publicando": 0,
|
|
|
|
|
|
|
|
"devam etmekte": 0,
|
|
|
|
|
|
|
|
"連載中": 0,
|
|
|
|
|
|
|
|
"Đã hoàn thành": 1,
|
|
|
|
"Đã hoàn thành": 1,
|
|
|
|
"مكتملة": 1,
|
|
|
|
"مكتملة": 1,
|
|
|
|
"Завершено": 1,
|
|
|
|
"Завершено": 1,
|
|
|
|
@@ -135,85 +129,69 @@ class MangaReader extends MProvider {
|
|
|
|
"One-Shot": 1,
|
|
|
|
"One-Shot": 1,
|
|
|
|
"Bitti": 1,
|
|
|
|
"Bitti": 1,
|
|
|
|
"จบแล้ว": 1,
|
|
|
|
"จบแล้ว": 1,
|
|
|
|
"tamat": 1,
|
|
|
|
|
|
|
|
"completado": 1,
|
|
|
|
|
|
|
|
"concluído": 1,
|
|
|
|
|
|
|
|
"完結": 1,
|
|
|
|
|
|
|
|
"concluido": 1,
|
|
|
|
|
|
|
|
"bitmiş": 1,
|
|
|
|
|
|
|
|
"hiatus": 2,
|
|
|
|
"hiatus": 2,
|
|
|
|
"พักชั่วคราว": 2,
|
|
|
|
"พักชั่วคราว": 2,
|
|
|
|
"on hold": 2,
|
|
|
|
|
|
|
|
"pausado": 2,
|
|
|
|
|
|
|
|
"en espera": 2,
|
|
|
|
|
|
|
|
"en pause": 2,
|
|
|
|
|
|
|
|
"en attente": 2,
|
|
|
|
|
|
|
|
"canceled": 3,
|
|
|
|
|
|
|
|
"cancelled": 3,
|
|
|
|
|
|
|
|
"cancelado": 3,
|
|
|
|
|
|
|
|
"cancellato": 3,
|
|
|
|
|
|
|
|
"cancelados": 3,
|
|
|
|
|
|
|
|
"dropped": 3,
|
|
|
|
|
|
|
|
"discontinued": 3,
|
|
|
|
|
|
|
|
"abandonné": 3
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
];
|
|
|
|
];
|
|
|
|
url = getUrlWithoutDomain(url);
|
|
|
|
url = getUrlWithoutDomain(url);
|
|
|
|
MManga manga = MManga();
|
|
|
|
MManga manga = MManga();
|
|
|
|
|
|
|
|
|
|
|
|
final res = (await client.get(Uri.parse("$baseUrl$url"))).body;
|
|
|
|
final res = (await client.get(Uri.parse("$baseUrl$url"))).body;
|
|
|
|
final document = parseHtml(res);
|
|
|
|
List<String> author = xpath(
|
|
|
|
final seriesDetails = document.selectFirst(
|
|
|
|
res,
|
|
|
|
"div.bigcontent, div.animefull, div.main-info, div.postbody");
|
|
|
|
"//table[contains(@class, 'infotable')]//tr[contains(text(), 'Author')]/td[last()]/text() | //div[contains(@class, 'tsinfo')]//div[contains(@class, 'imptdt') and contains(text(), 'Author')]//i/text() | //div[contains(@class, 'fmed')]//b[contains(text(), 'Author')]/following-sibling::span[1]/text() | //span[contains(text(), 'Author')]/text() | //div[contains(@class, 'tsinfo')]//div[contains(@class, 'imptdt')]//span[contains(text(), 'ผู้วาด')]/following-sibling::i/text()",
|
|
|
|
manga.author = seriesDetails
|
|
|
|
'');
|
|
|
|
.selectFirst(".infotable tr:contains(Author) td:last-child, .tsinfo .imptdt:contains(Author) i, .fmed b:contains(Author)+span, span:contains(Author), " +
|
|
|
|
if (author.isEmpty) {
|
|
|
|
".infotable tr:contains(Auteur) td:last-child, .tsinfo .imptdt:contains(Auteur) i, .fmed b:contains(Auteur)+span, span:contains(Auteur), " +
|
|
|
|
author = xpath(
|
|
|
|
".infotable tr:contains(autor) td:last-child, .tsinfo .imptdt:contains(autor) i, .fmed b:contains(autor)+span, span:contains(autor), " +
|
|
|
|
res,
|
|
|
|
".infotable tr:contains(المؤلف) td:last-child, .tsinfo .imptdt:contains(المؤلف) i, .fmed b:contains(المؤلف)+span, span:contains(المؤلف), " +
|
|
|
|
"//table[contains(@class, 'infotable')]//tr[contains(text(), '${authorLocalStr(source.lang)}')]/td[last()]/text() | //div[contains(@class, 'tsinfo')]//div[contains(@class, 'imptdt') and contains(text(), '${authorLocalStr(source.lang)}')]//i/text() | //div[contains(@class, 'fmed')]//b[contains(text(), '${authorLocalStr(source.lang)}')]/following-sibling::span[1]/text() | //span[contains(text(), '${authorLocalStr(source.lang)}')]/text() | //div[contains(@class, 'tsinfo')]//div[contains(@class, 'imptdt')]//span[contains(text(), 'ผู้แต่ง')]/following-sibling::i/text()",
|
|
|
|
".infotable tr:contains(Mangaka) td:last-child, .tsinfo .imptdt:contains(Mangaka) i, .fmed b:contains(Mangaka)+span, span:contains(Mangaka), " +
|
|
|
|
'');
|
|
|
|
".infotable tr:contains(seniman) td:last-child, .tsinfo .imptdt:contains(seniman) i, .fmed b:contains(seniman)+span, span:contains(seniman), " +
|
|
|
|
}
|
|
|
|
".infotable tr:contains(Pengarang) td:last-child, .tsinfo .imptdt:contains(Pengarang) i, .fmed b:contains(Pengarang)+span, span:contains(Pengarang), " +
|
|
|
|
if (author.isNotEmpty) {
|
|
|
|
".infotable tr:contains(Yazar) td:last-child, .tsinfo .imptdt:contains(Yazar) i, .fmed b:contains(Yazar)+span, span:contains(Yazar), " +
|
|
|
|
manga.author = author.first;
|
|
|
|
".infotable tr:contains(ผู้วาด) td:last-child, .tsinfo .imptdt:contains(ผู้วาด) i, .fmed b:contains(ผู้วาด)+span, span:contains(ผู้วาด), ")
|
|
|
|
}
|
|
|
|
.text;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
manga.description = seriesDetails
|
|
|
|
final description = parseHtml(res)
|
|
|
|
.selectFirst(".desc, .entry-content[itemprop=description]")
|
|
|
|
.selectFirst(
|
|
|
|
|
|
|
|
".desc, .entry-content[itemprop=description], .tsinfo > .wd-full > .entry-content[itemprop=description]")
|
|
|
|
?.text;
|
|
|
|
?.text;
|
|
|
|
final status = seriesDetails
|
|
|
|
|
|
|
|
.selectFirst(".infotable tr:contains(status) td:last-child, .tsinfo .imptdt:contains(status) i, .fmed b:contains(status)+span span:contains(status), " +
|
|
|
|
if (description != null) {
|
|
|
|
".infotable tr:contains(Statut) td:last-child, .tsinfo .imptdt:contains(Statut) i, .fmed b:contains(Statut)+span span:contains(Statut), " +
|
|
|
|
manga.description = description;
|
|
|
|
".infotable tr:contains(Durum) td:last-child, .tsinfo .imptdt:contains(Durum) i, .fmed b:contains(Durum)+span span:contains(Durum), " +
|
|
|
|
}
|
|
|
|
".infotable tr:contains(連載状況) td:last-child, .tsinfo .imptdt:contains(連載状況) i, .fmed b:contains(連載状況)+span span:contains(連載状況), " +
|
|
|
|
|
|
|
|
".infotable tr:contains(Estado) td:last-child, .tsinfo .imptdt:contains(Estado) i, .fmed b:contains(Estado)+span span:contains(Estado), " +
|
|
|
|
List<String> status = xpath(
|
|
|
|
".infotable tr:contains(الحالة) td:last-child, .tsinfo .imptdt:contains(الحالة) i, .fmed b:contains(الحالة)+span span:contains(الحالة), " +
|
|
|
|
res,
|
|
|
|
".infotable tr:contains(حالة العمل) td:last-child, .tsinfo .imptdt:contains(حالة العمل) i, .fmed b:contains(حالة العمل)+span span:contains(حالة العمل), " +
|
|
|
|
"//table[contains(@class, 'infotable')]//tr[contains(text(), 'Status')]/td[last()]/text() | //div[contains(@class, 'tsinfo')]//div[contains(@class, 'imptdt') and contains(text(), 'Status')]//i/text() | //div[contains(@class, 'fmed')]//b[contains(text(), 'Status')]/following-sibling::span[1]/text() | //span[contains(text(), 'Status')]/text() | | //div[contains(@class, 'tsinfo')]//div[contains(@class, 'imptdt')]//span[contains(text(), 'สถานะ')]/following-sibling::i/text()",
|
|
|
|
".infotable tr:contains(สถานะ) td:last-child, .tsinfo .imptdt:contains(สถานะ) i, .fmed b:contains(สถานะ)+span span:contains(สถานะ), " +
|
|
|
|
'');
|
|
|
|
".infotable tr:contains(stato) td:last-child, .tsinfo .imptdt:contains(stato) i, .fmed b:contains(stato)+span span:contains(stato), " +
|
|
|
|
if (status.isEmpty) {
|
|
|
|
".infotable tr:contains(Statüsü) td:last-child, .tsinfo .imptdt:contains(Statüsü) i, .fmed b:contains(Statüsü)+span span:contains(Statüsü), " +
|
|
|
|
status = xpath(
|
|
|
|
".infotable tr:contains(สถานะ) td:last-child, .tsinfo .imptdt:contains(สถานะ) i, .fmed b:contains(สถานะ)+span span:contains(สถานะ)")
|
|
|
|
res,
|
|
|
|
?.text ??
|
|
|
|
"//table[contains(@class, 'infotable')]//tr[contains(text(), '${statusLocalStr(source.lang)}')]/td[last()]/text() | //div[contains(@class, 'tsinfo')]//div[contains(@class, 'imptdt') and contains(text(), '${statusLocalStr(source.lang)}')]//i/text() | //div[contains(@class, 'fmed')]//b[contains(text(), '${statusLocalStr(source.lang)}')]/following-sibling::span[1]/text() | //span[contains(text(), '${statusLocalStr(source.lang)}')]/text()",
|
|
|
|
"";
|
|
|
|
'');
|
|
|
|
manga.status = parseStatus(status, statusList);
|
|
|
|
}
|
|
|
|
manga.genre = seriesDetails
|
|
|
|
|
|
|
|
.select("div.gnr a, .mgen a, .seriestugenre a, " +
|
|
|
|
if (status.isNotEmpty) {
|
|
|
|
"span:contains(genre) , span:contains(التصنيف)")
|
|
|
|
manga.status = parseStatus(status.first, statusList);
|
|
|
|
.map((e) => e.text)
|
|
|
|
}
|
|
|
|
.toList();
|
|
|
|
|
|
|
|
final elements = document.select(
|
|
|
|
manga.genre = xpath(res,
|
|
|
|
"div.bxcl li, div.cl li, #chapterlist li, ul li:has(div.chbox):has(div.eph-num)");
|
|
|
|
'//*[@class="gnr" or @class="mgen" or @class="seriestugenre" ]/a/text()');
|
|
|
|
|
|
|
|
var chapUrls = xpath(res,
|
|
|
|
|
|
|
|
'//*[@class="bxcl" or @class="cl" or @class="chbox" or @class="eph-num" or @id="chapterlist"]/div/a[not(contains(@href,"{{number}}"))]/@href');
|
|
|
|
|
|
|
|
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(contains(text(),"{{number}}")) or @class="lch" and not(text()="Chapter {{number}}")]/text()');
|
|
|
|
|
|
|
|
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(contains(text(),"{{date}}"))]/text()');
|
|
|
|
|
|
|
|
var dateUploads =
|
|
|
|
|
|
|
|
parseDates(chapterDates, source.dateFormat, source.dateFormatLocale);
|
|
|
|
|
|
|
|
|
|
|
|
List<MChapter>? chaptersList = [];
|
|
|
|
List<MChapter>? chaptersList = [];
|
|
|
|
for (var element in elements) {
|
|
|
|
for (var i = 0; i < chaptersNames.length; i++) {
|
|
|
|
final urlElements = element.selectFirst("a");
|
|
|
|
MChapter chapter = MChapter();
|
|
|
|
final name =
|
|
|
|
chapter.name = chaptersNames[i];
|
|
|
|
element.selectFirst(".lch a, .chapternum")?.text ?? urlElements.text;
|
|
|
|
chapter.url = chapUrls[i];
|
|
|
|
var chapter = MChapter();
|
|
|
|
chapter.dateUpload = dateUploads[i];
|
|
|
|
chapter.name = name;
|
|
|
|
|
|
|
|
chapter.url = urlElements.attr("href");
|
|
|
|
|
|
|
|
chapter.dateUpload = parseDates([
|
|
|
|
|
|
|
|
element.selectFirst(".chapterdate")?.text ??
|
|
|
|
|
|
|
|
DateTime.now().millisecondsSinceEpoch.toString()
|
|
|
|
|
|
|
|
], source.dateFormat, source.dateFormatLocale)[0];
|
|
|
|
|
|
|
|
chaptersList.add(chapter);
|
|
|
|
chaptersList.add(chapter);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
manga.chapters = chaptersList;
|
|
|
|
manga.chapters = chaptersList;
|
|
|
|
@@ -224,24 +202,32 @@ class MangaReader extends MProvider {
|
|
|
|
Future<List<String>> getPageList(String url) async {
|
|
|
|
Future<List<String>> getPageList(String url) async {
|
|
|
|
url = getUrlWithoutDomain(url);
|
|
|
|
url = getUrlWithoutDomain(url);
|
|
|
|
final res = (await client.get(Uri.parse('$baseUrl$url'))).body;
|
|
|
|
final res = (await client.get(Uri.parse('$baseUrl$url'))).body;
|
|
|
|
List<String> pagesUrl = [];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final htmlElements = parseHtml(res).select("div#readerarea img");
|
|
|
|
List<String> pages = [];
|
|
|
|
for (var htmlElement in htmlElements) {
|
|
|
|
List<String> pagesUrl = [];
|
|
|
|
String img = htmlElement.getSrc;
|
|
|
|
bool invalidImgs = false;
|
|
|
|
if (img.contains("data:image")) {
|
|
|
|
pages = xpath(res, '//*[@id="readerarea"]/p/img/@src');
|
|
|
|
img = htmlElement.getDataSrc;
|
|
|
|
if (pages.isEmpty || pages.length == 1) {
|
|
|
|
|
|
|
|
pages = xpath(res, '//*[@id="readerarea"]/img/@src');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
pagesUrl.add(img);
|
|
|
|
if (pages.length > 1) {
|
|
|
|
|
|
|
|
for (var page in pages) {
|
|
|
|
|
|
|
|
if (page.contains("data:image")) {
|
|
|
|
|
|
|
|
invalidImgs = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (pagesUrl.isEmpty || pagesUrl.length == 1) {
|
|
|
|
}
|
|
|
|
RegExp exp = RegExp("\"images\"\\s*:\\s*(\\[.*?])");
|
|
|
|
if (invalidImgs) {
|
|
|
|
var match = exp.allMatches(res).toList()[0] as RegExpMatch;
|
|
|
|
pages = xpath(res, '//*[@id="readerarea"]/img/@data-src');
|
|
|
|
final images = match.group(1);
|
|
|
|
}
|
|
|
|
final pages = json.decode(images!) as List;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (pages.isEmpty || pages.length == 1) {
|
|
|
|
|
|
|
|
final images = regExp(res, "\"images\"\\s*:\\s*(\\[.*?])", "", 1, 1);
|
|
|
|
|
|
|
|
final pages = json.decode(images) as List;
|
|
|
|
for (var page in pages) {
|
|
|
|
for (var page in pages) {
|
|
|
|
pagesUrl.add(page);
|
|
|
|
pagesUrl.add(page);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return pages;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return pagesUrl;
|
|
|
|
return pagesUrl;
|
|
|
|
@@ -249,18 +235,28 @@ class MangaReader extends MProvider {
|
|
|
|
|
|
|
|
|
|
|
|
MPages mangaRes(String res) {
|
|
|
|
MPages mangaRes(String res) {
|
|
|
|
List<MManga> mangaList = [];
|
|
|
|
List<MManga> mangaList = [];
|
|
|
|
final document = parseHtml(res);
|
|
|
|
final urls = xpath(
|
|
|
|
final elements =
|
|
|
|
res, '//*[ @class="imgu" or @class="bsx" or @class="card"]/a/@href');
|
|
|
|
document.select(".utao .uta .imgu, .listupd .bs .bsx, .listo .bs .bsx");
|
|
|
|
final names = xpath(
|
|
|
|
for (var element in elements) {
|
|
|
|
res, '//*[ @class="imgu" or @class="bsx" or @class="card"]/a/@title');
|
|
|
|
String img = element.getSrc;
|
|
|
|
List<String> images = [];
|
|
|
|
|
|
|
|
images = xpath(res,
|
|
|
|
|
|
|
|
'//*[ @class="imgu" or @class="bsx"]/a/div[1]/img/@src | //div[@class="card"]/div[@class="card__img"]/@data-background-img');
|
|
|
|
|
|
|
|
bool invalidImgs = false;
|
|
|
|
|
|
|
|
for (var img in images) {
|
|
|
|
if (img.contains("data:image")) {
|
|
|
|
if (img.contains("data:image")) {
|
|
|
|
img = element.getDataSrc;
|
|
|
|
invalidImgs = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var manga = MManga();
|
|
|
|
}
|
|
|
|
manga.name = element.selectFirst("a").attr("title");
|
|
|
|
if (invalidImgs) {
|
|
|
|
manga.imageUrl = img;
|
|
|
|
images = xpath(res,
|
|
|
|
manga.link = element.selectFirst("a").attr("href");
|
|
|
|
'//*[ @class="imgu" or @class="bsx"]/a/div[1]/img/@data-src | //div[@class="card"]/a/div[@class="card__img--hover"]/@data-background-img');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
for (var i = 0; i < names.length; i++) {
|
|
|
|
|
|
|
|
MManga manga = MManga();
|
|
|
|
|
|
|
|
manga.name = names[i];
|
|
|
|
|
|
|
|
manga.imageUrl = images[i];
|
|
|
|
|
|
|
|
manga.link = urls[i];
|
|
|
|
mangaList.add(manga);
|
|
|
|
mangaList.add(manga);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -316,6 +312,22 @@ class MangaReader extends MProvider {
|
|
|
|
];
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String authorLocalStr(String lang) {
|
|
|
|
|
|
|
|
if (lang == "fr") {
|
|
|
|
|
|
|
|
return "Auteur";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return "Author";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String statusLocalStr(String lang) {
|
|
|
|
|
|
|
|
if (lang == "fr") {
|
|
|
|
|
|
|
|
return "Statut";
|
|
|
|
|
|
|
|
} else if (lang == "es") {
|
|
|
|
|
|
|
|
return "Estado";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return "Status";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
String ll(String url) {
|
|
|
|
String ll(String url) {
|
|
|
|
if (url.contains("?")) {
|
|
|
|
if (url.contains("?")) {
|
|
|
|
return "&";
|
|
|
|
return "&";
|
|
|
|
|