mirror of
https://github.com/kodjodevf/mangayomi-extensions.git
synced 2026-02-14 10:51:17 +00:00
Add New sources: BeastScan (AR), Lelmanga (FR) & remove unused code
This commit is contained in:
@@ -224,11 +224,6 @@ class HeanCms extends MProvider {
|
||||
List<String> sources = ["YugenMangas", "Reaper Scans", "Perf Scan"];
|
||||
return sources.contains(sourceName);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<MVideo>> getVideoList(MSource source, String url) async {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, String> getHeader(String url) {
|
||||
|
||||
@@ -15,8 +15,7 @@ class Madara extends MProvider {
|
||||
final names = xpath(res, '//*[@id^="manga-item"]/a/@title');
|
||||
var images = xpath(res, '//*[@id^="manga-item"]/a/img/@data-src');
|
||||
if (images.isEmpty) {
|
||||
images =
|
||||
xpath(res, '//*[@id^="manga-item"]/a/img/@data-lazy-src');
|
||||
images = xpath(res, '//*[@id^="manga-item"]/a/img/@data-lazy-src');
|
||||
if (images.isEmpty) {
|
||||
images = xpath(res, '//*[@id^="manga-item"]/a/img/@srcset');
|
||||
if (images.isEmpty) {
|
||||
@@ -47,8 +46,7 @@ class Madara extends MProvider {
|
||||
final names = xpath(res, '//*[@id^="manga-item"]/a/@title');
|
||||
var images = xpath(res, '//*[@id^="manga-item"]/a/img/@data-src');
|
||||
if (images.isEmpty) {
|
||||
images =
|
||||
xpath(res, '//*[@id^="manga-item"]/a/img/@data-lazy-src');
|
||||
images = xpath(res, '//*[@id^="manga-item"]/a/img/@data-lazy-src');
|
||||
if (images.isEmpty) {
|
||||
images = xpath(res, '//*[@id^="manga-item"]/a/img/@srcset');
|
||||
if (images.isEmpty) {
|
||||
@@ -77,21 +75,19 @@ class Madara extends MProvider {
|
||||
final res = await http('GET', json.encode(data));
|
||||
|
||||
List<MManga> mangaList = [];
|
||||
final urls =
|
||||
xpath(res, '//*[@class^="tab-thumb c-image-hover"]/a/@href');
|
||||
final names =
|
||||
xpath(res, '//*[@class^="tab-thumb c-image-hover"]/a/@title');
|
||||
var images = xpath(
|
||||
res, '//*[@class^="tab-thumb c-image-hover"]/a/img/@data-src');
|
||||
final urls = xpath(res, '//*[@class^="tab-thumb c-image-hover"]/a/@href');
|
||||
final names = xpath(res, '//*[@class^="tab-thumb c-image-hover"]/a/@title');
|
||||
var images =
|
||||
xpath(res, '//*[@class^="tab-thumb c-image-hover"]/a/img/@data-src');
|
||||
if (images.isEmpty) {
|
||||
images = xpath(
|
||||
res, '//*[@class^="tab-thumb c-image-hover"]/a/img/@data-lazy-src');
|
||||
if (images.isEmpty) {
|
||||
images = xpath(
|
||||
res, '//*[@class^="tab-thumb c-image-hover"]/a/img/@srcset');
|
||||
images =
|
||||
xpath(res, '//*[@class^="tab-thumb c-image-hover"]/a/img/@srcset');
|
||||
if (images.isEmpty) {
|
||||
images = xpath(
|
||||
res, '//*[@class^="tab-thumb c-image-hover"]/a/img/@src');
|
||||
images =
|
||||
xpath(res, '//*[@class^="tab-thumb c-image-hover"]/a/img/@src');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -158,39 +154,45 @@ class Madara extends MProvider {
|
||||
final datas = {"url": url, "sourceId": source.id};
|
||||
res = await http('GET', json.encode(datas));
|
||||
|
||||
manga.author = querySelectorAll(res,
|
||||
selector: "div.author-content > a",
|
||||
typeElement: 0,
|
||||
attributes: "",
|
||||
typeRegExp: 0)
|
||||
.first;
|
||||
manga.description = querySelectorAll(res,
|
||||
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",
|
||||
typeElement: 0,
|
||||
attributes: "",
|
||||
typeRegExp: 0)
|
||||
.first;
|
||||
manga.imageUrl = querySelectorAll(res,
|
||||
selector: "div.summary_image img",
|
||||
typeElement: 2,
|
||||
attributes: "",
|
||||
typeRegExp: 2)
|
||||
.first;
|
||||
final author = querySelectorAll(res,
|
||||
selector: "div.author-content > a",
|
||||
typeElement: 0,
|
||||
attributes: "",
|
||||
typeRegExp: 0);
|
||||
if (author.isNotEmpty) {
|
||||
manga.author = author.first;
|
||||
}
|
||||
final description = querySelectorAll(res,
|
||||
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",
|
||||
typeElement: 0,
|
||||
attributes: "",
|
||||
typeRegExp: 0);
|
||||
if (description.isNotEmpty) {
|
||||
manga.description = description.first;
|
||||
}
|
||||
final imageUrl = querySelectorAll(res,
|
||||
selector: "div.summary_image img",
|
||||
typeElement: 2,
|
||||
attributes: "",
|
||||
typeRegExp: 2);
|
||||
if (imageUrl.isNotEmpty) {
|
||||
manga.imageUrl = imageUrl.first;
|
||||
}
|
||||
final mangaId = querySelectorAll(res,
|
||||
selector: "div[id^=manga-chapters-holder]",
|
||||
typeElement: 3,
|
||||
attributes: "data-id",
|
||||
typeRegExp: 0)
|
||||
.first;
|
||||
manga.status = parseStatus(
|
||||
querySelectorAll(res,
|
||||
selector: "div.summary-content",
|
||||
typeElement: 0,
|
||||
attributes: "",
|
||||
typeRegExp: 0)
|
||||
.last,
|
||||
statusList);
|
||||
final status = querySelectorAll(res,
|
||||
selector: "div.summary-content",
|
||||
typeElement: 0,
|
||||
attributes: "",
|
||||
typeRegExp: 0);
|
||||
if (status.isNotEmpty) {
|
||||
manga.status = parseStatus(status.last, statusList);
|
||||
}
|
||||
|
||||
manga.genre = querySelectorAll(res,
|
||||
selector: "div.genres-content a",
|
||||
@@ -208,13 +210,9 @@ class Madara extends MProvider {
|
||||
"${baseUrl}wp-admin/admin-ajax.php?action=manga_get_chapters&manga=$mangaId";
|
||||
final datasP = {"url": urll, "headers": headers, "sourceId": source.id};
|
||||
res = await http('POST', json.encode(datasP));
|
||||
if (res == "400") {
|
||||
if (res == "error") {
|
||||
final urlP = "${url}ajax/chapters";
|
||||
final datasP = {
|
||||
"url": urlP,
|
||||
"headers": headers,
|
||||
"sourceId": source.id
|
||||
};
|
||||
final datasP = {"url": urlP, "headers": headers, "sourceId": source.id};
|
||||
res = await http('POST', json.encode(datasP));
|
||||
}
|
||||
|
||||
@@ -231,8 +229,8 @@ class Madara extends MProvider {
|
||||
dateF = xpath(resWebview,
|
||||
"//*[@id='manga-chapters-holder']/div[2]/div/ul/li/span/i/text()");
|
||||
}
|
||||
var dateUploads = parseDates(
|
||||
dateF, source.dateFormat, source.dateFormatLocale);
|
||||
var dateUploads =
|
||||
parseDates(dateF, source.dateFormat, source.dateFormatLocale);
|
||||
if (dateF.length < chaptersNames.length) {
|
||||
final length = chaptersNames.length - dateF.length;
|
||||
String date = "${DateTime.now().millisecondsSinceEpoch}";
|
||||
@@ -240,8 +238,8 @@ class Madara extends MProvider {
|
||||
date += "--..${DateTime.now().millisecondsSinceEpoch}";
|
||||
}
|
||||
|
||||
final dateFF = parseDates(
|
||||
dateF, source.dateFormat, source.dateFormatLocale);
|
||||
final dateFF =
|
||||
parseDates(dateF, source.dateFormat, source.dateFormatLocale);
|
||||
List<String> chapterDate = date.split('--..');
|
||||
|
||||
for (var date in dateFF) {
|
||||
@@ -314,11 +312,6 @@ class Madara extends MProvider {
|
||||
}
|
||||
return pageUrls;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<MVideo>> getVideoList(MSource source, String url) async {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
Madara main() {
|
||||
|
||||
@@ -92,33 +92,41 @@ class MangaReader extends MProvider {
|
||||
final datas = {"url": url, "sourceId": source.id};
|
||||
final res = await http('GET', json.encode(datas));
|
||||
|
||||
manga.author = xpath(
|
||||
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()',
|
||||
'')
|
||||
.first
|
||||
.replaceAll("Autor", "")
|
||||
.replaceAll("Author", "")
|
||||
.replaceAll("Auteur", "")
|
||||
.replaceAll("[Add, ]", "");
|
||||
final author = xpath(
|
||||
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()',
|
||||
'');
|
||||
|
||||
manga.description = querySelectorAll(res,
|
||||
selector: ".desc, .entry-content[itemprop=description]",
|
||||
typeElement: 0,
|
||||
attributes: "",
|
||||
typeRegExp: 0)
|
||||
.first;
|
||||
if (author.isNotEmpty) {
|
||||
manga.author = author.first
|
||||
.replaceAll("Autor", "")
|
||||
.replaceAll("Author", "")
|
||||
.replaceAll("Auteur", "")
|
||||
.replaceAll("[Add, ]", "");
|
||||
}
|
||||
|
||||
final description = querySelectorAll(res,
|
||||
selector: ".desc, .entry-content[itemprop=description]",
|
||||
typeElement: 0,
|
||||
attributes: "",
|
||||
typeRegExp: 0);
|
||||
if (description.isNotEmpty) {
|
||||
manga.description = description.first;
|
||||
}
|
||||
|
||||
final status = xpath(
|
||||
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()',
|
||||
'')
|
||||
.first
|
||||
.replaceAll("Status", "")
|
||||
.replaceAll("Estado", "")
|
||||
.replaceAll("Statut", "");
|
||||
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()',
|
||||
'');
|
||||
|
||||
manga.status = parseStatus(status, statusList);
|
||||
if (status.isNotEmpty) {
|
||||
manga.status = parseStatus(
|
||||
status.first
|
||||
.replaceAll("Status", "")
|
||||
.replaceAll("Estado", "")
|
||||
.replaceAll("Statut", ""),
|
||||
statusList);
|
||||
}
|
||||
|
||||
manga.genre = xpath(res,
|
||||
'//*[@class="gnr" or @class="mgen" or @class="seriestugenre" ]/a/text()');
|
||||
@@ -130,8 +138,8 @@ class MangaReader extends MProvider {
|
||||
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()');
|
||||
|
||||
var dateUploads = parseDates(
|
||||
chapterDates, source.dateFormat, source.dateFormatLocale);
|
||||
var dateUploads =
|
||||
parseDates(chapterDates, source.dateFormat, source.dateFormatLocale);
|
||||
|
||||
List<MChapter>? chaptersList = [];
|
||||
for (var i = 0; i < chaptersNames.length; i++) {
|
||||
@@ -157,8 +165,7 @@ class MangaReader extends MProvider {
|
||||
pages = xpath(res, '//*[@id="readerarea"]/img/@src');
|
||||
}
|
||||
if (pages.isEmpty || pages.length == 1) {
|
||||
final images =
|
||||
regExp(res, "\"images\"\\s*:\\s*(\\[.*?])", "", 1, 1);
|
||||
final images = regExp(res, "\"images\"\\s*:\\s*(\\[.*?])", "", 1, 1);
|
||||
final pages = json.decode(images) as List;
|
||||
for (var page in pages) {
|
||||
pagesUrl.add(page);
|
||||
@@ -172,12 +179,10 @@ class MangaReader extends MProvider {
|
||||
|
||||
MPages mangaRes(String res) {
|
||||
List<MManga> mangaList = [];
|
||||
final urls =
|
||||
xpath(res, '//*[ @class="imgu" or @class="bsx"]/a/@href');
|
||||
final names =
|
||||
xpath(res, '//*[ @class="imgu" or @class="bsx"]/a/@title');
|
||||
final images = xpath(
|
||||
res, '//*[ @class="imgu" or @class="bsx"]/a/div[1]/img/@src');
|
||||
final urls = xpath(res, '//*[ @class="imgu" or @class="bsx"]/a/@href');
|
||||
final names = xpath(res, '//*[ @class="imgu" or @class="bsx"]/a/@title');
|
||||
final images =
|
||||
xpath(res, '//*[ @class="imgu" or @class="bsx"]/a/div[1]/img/@src');
|
||||
|
||||
for (var i = 0; i < names.length; i++) {
|
||||
MManga manga = MManga();
|
||||
@@ -196,11 +201,6 @@ class MangaReader extends MProvider {
|
||||
}
|
||||
return "/manga";
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<MVideo>> getVideoList(MSource source, String url) async {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
MangaReader main() {
|
||||
|
||||
@@ -9,6 +9,24 @@ const defaultDateFormatLocale = "en_US";
|
||||
|
||||
List<Source> get mangareaderSourcesList => _mangareaderSourcesList;
|
||||
List<Source> _mangareaderSourcesList = [
|
||||
Source(
|
||||
name: "Beast Scans",
|
||||
baseUrl: "https://beast-scans.com",
|
||||
lang: "ar",
|
||||
iconUrl: getIconUrl("asurascans", "en"),
|
||||
dateFormat: "MMMM dd, yyyy",
|
||||
dateFormatLocale: "ar",
|
||||
version: mangareaderVersion,
|
||||
sourceCodeUrl: mangareaderSourceCodeUrl),
|
||||
Source(
|
||||
name: "Lelmanga",
|
||||
baseUrl: "https://www.lelmanga.com",
|
||||
lang: "fr",
|
||||
iconUrl: getIconUrl("lelmanga", "fr"),
|
||||
dateFormat: "MMMM d, yyyy",
|
||||
dateFormatLocale: "en",
|
||||
version: mangareaderVersion,
|
||||
sourceCodeUrl: mangareaderSourceCodeUrl),
|
||||
Source(
|
||||
name: "Asura Scans",
|
||||
baseUrl: "https://asuratoon.com/",
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import 'package:mangayomi/bridge_lib.dart';
|
||||
import 'dart:convert';
|
||||
|
||||
class MMCRCms extends MProvider {
|
||||
MMCRCms();
|
||||
class MMRCMS extends MProvider {
|
||||
MMRCMS();
|
||||
|
||||
@override
|
||||
Future<MPages> getPopular(MSource source, int page) async {
|
||||
@@ -131,35 +131,33 @@ class MMCRCms extends MProvider {
|
||||
final datas = {"url": url, "sourceId": source.id};
|
||||
final res = await http('GET', json.encode(datas));
|
||||
|
||||
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()')
|
||||
.first;
|
||||
final 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()');
|
||||
if (author.isNotEmpty) {
|
||||
manga.author = author.first;
|
||||
}
|
||||
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()')
|
||||
.first;
|
||||
manga.status = parseStatus(status, statusList);
|
||||
manga.description =
|
||||
xpath(res, '//*[@class="well" or @class="manga well"]/p/text()')
|
||||
.first;
|
||||
'//*[@class="dl-horizontal"]/dt[contains(text(), "Statut") or contains(text(), "Status") or contains(text(), "Estado") or contains(text(), "Durum")]/following-sibling::dd[1]/text()');
|
||||
if (status.isNotEmpty) {
|
||||
manga.status = parseStatus(status.first, statusList);
|
||||
}
|
||||
|
||||
final description =
|
||||
xpath(res, '//*[@class="well" or @class="manga well"]/p/text()');
|
||||
if (description.isNotEmpty) {
|
||||
manga.description = description.first;
|
||||
}
|
||||
|
||||
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()');
|
||||
|
||||
final baseUrl = "${source.baseUrl}/";
|
||||
final headers = {
|
||||
"Referer": baseUrl,
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
"X-Requested-With": "XMLHttpRequest"
|
||||
};
|
||||
|
||||
var chapUrls =
|
||||
xpath(res, '//*[@class="chapter-title-rtl"]/a/@href');
|
||||
var chaptersNames =
|
||||
xpath(res, '//*[@class="chapter-title-rtl"]/a/text()');
|
||||
var chapUrls = xpath(res, '//*[@class="chapter-title-rtl"]/a/@href');
|
||||
var chaptersNames = xpath(res, '//*[@class="chapter-title-rtl"]/a/text()');
|
||||
var chaptersDates =
|
||||
xpath(res, '//*[@class="date-chapter-title-rtl"]/text()');
|
||||
|
||||
var dateUploads = parseDates(
|
||||
chaptersDates, source.dateFormat, source.dateFormatLocale);
|
||||
var dateUploads =
|
||||
parseDates(chaptersDates, source.dateFormat, source.dateFormatLocale);
|
||||
|
||||
List<MChapter>? chaptersList = [];
|
||||
for (var i = 0; i < chaptersNames.length; i++) {
|
||||
@@ -179,8 +177,8 @@ class MMCRCms extends MProvider {
|
||||
final res = await http('GET', json.encode(datas));
|
||||
|
||||
List<String> pagesUrl = [];
|
||||
final pages = xpath(
|
||||
res, '//*[@id="all"]/img[@class="img-responsive"]/@data-src');
|
||||
final pages =
|
||||
xpath(res, '//*[@id="all"]/img[@class="img-responsive"]/@data-src');
|
||||
for (var page in pages) {
|
||||
if (page.startsWith('//')) {
|
||||
pagesUrl.add(page.replaceAll('//', 'https://'));
|
||||
@@ -191,13 +189,8 @@ class MMCRCms extends MProvider {
|
||||
|
||||
return pagesUrl;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<MVideo>> getVideoList(MSource source, String url) async {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
MMCRCms main() {
|
||||
return MMCRCms();
|
||||
MMRCMS main() {
|
||||
return MMRCMS();
|
||||
}
|
||||
|
||||
@@ -70,22 +70,7 @@ class NepNep extends MProvider {
|
||||
final vmChapters =
|
||||
substringBefore(substringAfter(script, "vm.Chapters = "), ";");
|
||||
final chapters = json.decode(vmChapters) as List;
|
||||
var chapUrls = chapters
|
||||
.map((ch) =>
|
||||
'/read-online/${substringAfter(url, "/manga/")}${chapterURLEncode(ch['Chapter'])}')
|
||||
.toList();
|
||||
|
||||
var chaptersNames = chapters.map((ch) {
|
||||
String name = ch['ChapterName'] ?? "";
|
||||
String indexChapter = ch['Chapter'];
|
||||
if (name.isEmpty) {
|
||||
name = '${ch['Type']} ${chapterImage(indexChapter, true)}';
|
||||
}
|
||||
return name;
|
||||
}).toList();
|
||||
var chaptersDates = chapters.map((ch) => ch['Date']).toList();
|
||||
var dateUploads =
|
||||
parseDates(chaptersDates, source.dateFormat, source.dateFormatLocale);
|
||||
List<MChapter> chaptersList = [];
|
||||
|
||||
for (var ch in chapters) {
|
||||
@@ -219,11 +204,6 @@ class NepNep extends MProvider {
|
||||
|
||||
return '-chapter-$n$suffix$index.html';
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<MVideo>> getVideoList(MSource source, String url) async {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, String> getHeader(String url) {
|
||||
|
||||
@@ -15,6 +15,7 @@ List<Source> _nepnepSourcesList = [
|
||||
lang: "en",
|
||||
typeSource: "nepnep",
|
||||
iconUrl: getIconUrl("mangasee", "en"),
|
||||
isFullData: true,
|
||||
dateFormat: defaultDateFormat,
|
||||
dateFormatLocale: defaultDateFormatLocale,
|
||||
version: nepnepVersion,
|
||||
@@ -26,6 +27,7 @@ List<Source> _nepnepSourcesList = [
|
||||
lang: "en",
|
||||
typeSource: "nepnep",
|
||||
iconUrl: getIconUrl("mangalife", "en"),
|
||||
isFullData: true,
|
||||
dateFormat: defaultDateFormat,
|
||||
dateFormatLocale: defaultDateFormatLocale,
|
||||
version: nepnepVersion,
|
||||
|
||||
@@ -189,11 +189,6 @@ class Batoto extends MProvider {
|
||||
}
|
||||
return "langs=$lang";
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<MVideo>> getVideoList(MSource source, String url) async {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, String> getMirrorPref() {
|
||||
|
||||
@@ -166,11 +166,6 @@ class ComickFun extends MProvider {
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<MVideo>> getVideoList(MSource source, String url) async {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, String> getHeader(String url) {
|
||||
|
||||
@@ -57,15 +57,10 @@ class MangaDex extends MProvider {
|
||||
res, r'$..data.relationships[*].attributes.name', ', ');
|
||||
|
||||
String expressionDescriptionA = r'$..data.attributes.description.en';
|
||||
String expressionDescription = regExp(
|
||||
r'$..data.attributes.description[a]',
|
||||
r'\[a\]',
|
||||
".${source.lang}",
|
||||
0,
|
||||
1);
|
||||
String expressionDescription = regExp(r'$..data.attributes.description[a]',
|
||||
r'\[a\]', ".${source.lang}", 0, 1);
|
||||
|
||||
String description =
|
||||
jsonPathToString(res, expressionDescription, '');
|
||||
String description = jsonPathToString(res, expressionDescription, '');
|
||||
if (description.isEmpty) {
|
||||
description = jsonPathToString(res, expressionDescriptionA, '');
|
||||
}
|
||||
@@ -81,29 +76,27 @@ class MangaDex extends MProvider {
|
||||
if (contentRating != "safe") {
|
||||
genres.add(contentRating);
|
||||
}
|
||||
String publicationDemographic = jsonPathToString(
|
||||
res, r'$..data.attributes.publicationDemographic', '');
|
||||
String publicationDemographic =
|
||||
jsonPathToString(res, r'$..data.attributes.publicationDemographic', '');
|
||||
if (publicationDemographic == "null") {
|
||||
} else {
|
||||
genres.add(publicationDemographic);
|
||||
}
|
||||
manga.genre = genres;
|
||||
String statusRes =
|
||||
jsonPathToString(res, r'$..data.attributes.status', '');
|
||||
String statusRes = jsonPathToString(res, r'$..data.attributes.status', '');
|
||||
manga.status = parseStatus(statusRes, statusList);
|
||||
final mangaId = url.split('/').last;
|
||||
|
||||
final paginatedChapterList =
|
||||
await paginatedChapterListRequest(mangaId, 0, source.lang);
|
||||
final chapterList =
|
||||
jsonPathToString(paginatedChapterList, r'$.data[*]', '_.')
|
||||
.split('_.');
|
||||
int limit = int.parse(
|
||||
jsonPathToString(paginatedChapterList, r'$.limit', ''));
|
||||
int offset = int.parse(
|
||||
jsonPathToString(paginatedChapterList, r'$.offset', ''));
|
||||
int total = int.parse(
|
||||
jsonPathToString(paginatedChapterList, r'$.total', ''));
|
||||
jsonPathToString(paginatedChapterList, r'$.data[*]', '_.').split('_.');
|
||||
int limit =
|
||||
int.parse(jsonPathToString(paginatedChapterList, r'$.limit', ''));
|
||||
int offset =
|
||||
int.parse(jsonPathToString(paginatedChapterList, r'$.offset', ''));
|
||||
int total =
|
||||
int.parse(jsonPathToString(paginatedChapterList, r'$.total', ''));
|
||||
List<MChapter> chapterListA = [];
|
||||
|
||||
final list =
|
||||
@@ -115,8 +108,7 @@ class MangaDex extends MProvider {
|
||||
offset += limit;
|
||||
var newRequest =
|
||||
await paginatedChapterListRequest(mangaId, offset, source.lang);
|
||||
int total =
|
||||
int.parse(jsonPathToString(newRequest, r'$.total', ''));
|
||||
int total = int.parse(jsonPathToString(newRequest, r'$.total', ''));
|
||||
final chapterList =
|
||||
jsonPathToString(paginatedChapterList, r'$.data[*]', '_.')
|
||||
.split('_.');
|
||||
@@ -159,8 +151,7 @@ class MangaDex extends MProvider {
|
||||
List<MChapter> getChapters(int length, String paginatedChapterListA) {
|
||||
List<MChapter> chaptersList = [];
|
||||
String paginatedChapterList = paginatedChapterListA.toString();
|
||||
final dataList =
|
||||
jsonPathToList(paginatedChapterList, r'$.data[*]', 0);
|
||||
final dataList = jsonPathToList(paginatedChapterList, r'$.data[*]', 0);
|
||||
for (var res in dataList) {
|
||||
String scan = "".toString();
|
||||
final groups = jsonPathToList(res,
|
||||
@@ -215,9 +206,8 @@ class MangaDex extends MProvider {
|
||||
chapterr.name = chapName;
|
||||
chapterr.url = id;
|
||||
chapterr.scanlator = scan;
|
||||
chapterr.dateUpload = parseDates(
|
||||
[date], "yyyy-MM-dd'T'HH:mm:ss+SSS", "en_US")
|
||||
.first;
|
||||
chapterr.dateUpload =
|
||||
parseDates([date], "yyyy-MM-dd'T'HH:mm:ss+SSS", "en_US").first;
|
||||
chaptersList.add(chapterr);
|
||||
}
|
||||
}
|
||||
@@ -268,11 +258,6 @@ class MangaDex extends MProvider {
|
||||
}
|
||||
return coverFileName;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<MVideo>> getVideoList(MSource source, String url) async {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
MangaDex main() {
|
||||
|
||||
@@ -13,12 +13,12 @@ class MangaHere extends MProvider {
|
||||
final res = await http('POST', json.encode(data));
|
||||
|
||||
List<MManga> mangaList = [];
|
||||
final names = xpath(
|
||||
res, '//*[ contains(@class, "manga-list-1-list")]/li/a/@title');
|
||||
final names =
|
||||
xpath(res, '//*[ contains(@class, "manga-list-1-list")]/li/a/@title');
|
||||
final images = xpath(res,
|
||||
'//*[ contains(@class, "manga-list-1-list")]/li/a/img[@class="manga-list-1-cover"]/@src');
|
||||
final urls = xpath(
|
||||
res, '//*[ contains(@class, "manga-list-1-list")]/li/a/@href');
|
||||
final urls =
|
||||
xpath(res, '//*[ contains(@class, "manga-list-1-list")]/li/a/@href');
|
||||
|
||||
for (var i = 0; i < names.length; i++) {
|
||||
MManga manga = MManga();
|
||||
@@ -40,12 +40,12 @@ class MangaHere extends MProvider {
|
||||
final res = await http('POST', json.encode(data));
|
||||
|
||||
List<MManga> mangaList = [];
|
||||
final names = xpath(
|
||||
res, '//*[ contains(@class, "manga-list-1-list")]/li/a/@title');
|
||||
final names =
|
||||
xpath(res, '//*[ contains(@class, "manga-list-1-list")]/li/a/@title');
|
||||
final images = xpath(res,
|
||||
'//*[ contains(@class, "manga-list-1-list")]/li/a/img[@class="manga-list-1-cover"]/@src');
|
||||
final urls = xpath(
|
||||
res, '//*[ contains(@class, "manga-list-1-list")]/li/a/@href');
|
||||
final urls =
|
||||
xpath(res, '//*[ contains(@class, "manga-list-1-list")]/li/a/@href');
|
||||
|
||||
for (var i = 0; i < names.length; i++) {
|
||||
MManga manga = MManga();
|
||||
@@ -67,12 +67,12 @@ class MangaHere extends MProvider {
|
||||
final res = await http('POST', json.encode(data));
|
||||
|
||||
List<MManga> mangaList = [];
|
||||
final names = xpath(
|
||||
res, '//*[contains(@class, "manga-list-4-list")]/li/a/@title');
|
||||
final names =
|
||||
xpath(res, '//*[contains(@class, "manga-list-4-list")]/li/a/@title');
|
||||
final images = xpath(res,
|
||||
'//*[contains(@class, "manga-list-4-list")]/li/a/img[@class="manga-list-4-cover"]/@src');
|
||||
final urls = xpath(
|
||||
res, '//*[contains(@class, "manga-list-4-list")]/li/a/@href');
|
||||
final urls =
|
||||
xpath(res, '//*[contains(@class, "manga-list-4-list")]/li/a/@href');
|
||||
|
||||
for (var i = 0; i < names.length; i++) {
|
||||
MManga manga = MManga();
|
||||
@@ -95,25 +95,21 @@ class MangaHere extends MProvider {
|
||||
final res = await http('GET', json.encode(data));
|
||||
MManga manga = MManga();
|
||||
manga.author =
|
||||
xpath(res, '//*[@class="detail-info-right-say"]/a/text()')
|
||||
.first;
|
||||
manga.description =
|
||||
xpath(res, '//*[@class="fullcontent"]/text()').first;
|
||||
xpath(res, '//*[@class="detail-info-right-say"]/a/text()').first;
|
||||
manga.description = xpath(res, '//*[@class="fullcontent"]/text()').first;
|
||||
final status =
|
||||
xpath(res, '//*[@class="detail-info-right-title-tip"]/text()')
|
||||
.first;
|
||||
xpath(res, '//*[@class="detail-info-right-title-tip"]/text()').first;
|
||||
manga.status = parseStatus(status, statusList);
|
||||
manga.genre =
|
||||
xpath(res, '//*[@class="detail-info-right-tag-list"]/a/text()');
|
||||
|
||||
var chapUrls =
|
||||
xpath(res, '//*[@class="detail-main-list"]/li/a/@href');
|
||||
var chapUrls = xpath(res, '//*[@class="detail-main-list"]/li/a/@href');
|
||||
var chaptersNames = xpath(res,
|
||||
'//*[@class="detail-main-list"]/li/a/div/p[@class="title3"]/text()');
|
||||
final chapterDates = xpath(res,
|
||||
'//*[@class="detail-main-list"]/li/a/div/p[@class="title2"]/text()');
|
||||
var dateUploads = parseDates(
|
||||
chapterDates, source.dateFormat, source.dateFormatLocale);
|
||||
var dateUploads =
|
||||
parseDates(chapterDates, source.dateFormat, source.dateFormatLocale);
|
||||
|
||||
List<MChapter>? chaptersList = [];
|
||||
for (var i = 0; i < chaptersNames.length; i++) {
|
||||
@@ -190,8 +186,7 @@ class MangaHere extends MProvider {
|
||||
}
|
||||
}
|
||||
}
|
||||
String deobfuscatedScript =
|
||||
evalJs(responseText.replaceAll("eval", ""));
|
||||
String deobfuscatedScript = evalJs(responseText.replaceAll("eval", ""));
|
||||
|
||||
int baseLinkStartPos = deobfuscatedScript.indexOf("pix=") + 5;
|
||||
int baseLinkEndPos =
|
||||
@@ -210,11 +205,6 @@ class MangaHere extends MProvider {
|
||||
|
||||
return pageUrls;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<MVideo>> getVideoList(MSource source, String url) async {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, String> getHeader(String url) {
|
||||
|
||||
Reference in New Issue
Block a user