anime source : gogoanime

This commit is contained in:
kodjomoustapha
2023-07-26 22:12:31 +01:00
parent 66473b9b8e
commit 03c7f91da1
20 changed files with 324 additions and 132 deletions

View File

@@ -0,0 +1,203 @@
import 'dart:convert';
import 'package:bridge_lib/bridge_lib.dart';
searchManga(MangaModel manga) async {
final headers = getHeader(manga.baseUrl);
final url = "${manga.apiUrl}/series/search";
final body = {"term": manga.query};
final data = {"url": url, "headers": headers, "body": body};
final res = await MBridge.http(json.encode(data), 1);
if (res.isEmpty) {
return manga;
}
List<String> jsonList = [];
List<String> names = [];
List<String> urls = [];
List<String> images = [];
if (res.startsWith("{")) {
jsonList = MBridge.jsonPathToList(res, r'$.data[*]');
} else {
jsonList = MBridge.jsonDecodeToList(res);
}
for (var a in jsonList) {
final thumbnail = MBridge.getMapValue(a, "thumbnail", 0);
if (thumbnail.startsWith("https://")) {
images.add(thumbnail);
} else {
images.add("${manga.apiUrl}/cover/$thumbnail");
}
names.add(MBridge.getMapValue(a, "title", 0));
final seriesSlug = MBridge.regExp(
MBridge.getMapValue(a, "series_slug", 0), "-\\d+", "", 0, 0);
urls.add("/series/$seriesSlug");
}
manga.urls = urls;
manga.images = images;
manga.names = names;
return manga;
}
getPopularManga(MangaModel manga) async {
final headers = getHeader(manga.baseUrl);
final url = "${manga.apiUrl}/series/querysearch";
final body = {
"page": manga.page,
"order": "desc",
"order_by": "total_views",
"series_status": "Ongoing",
"series_type": "Comic"
};
final data = {
"url": url,
"headers": headers,
"sourceId": manga.sourceId,
"body": body
};
final res = await MBridge.http(json.encode(data), 1);
if (res.isEmpty) {
return manga;
}
List<String> jsonList = [];
List<String> names = [];
List<String> urls = [];
List<String> images = [];
if (res.startsWith("{")) {
jsonList = MBridge.jsonPathToList(res, r'$.data[*]');
} else {
jsonList = MBridge.jsonDecodeToList(res);
}
for (var a in jsonList) {
final thumbnail = MBridge.getMapValue(a, "thumbnail", 0);
if (thumbnail.startsWith("https://")) {
images.add(thumbnail);
} else {
images.add("${manga.apiUrl}/cover/$thumbnail");
}
names.add(MBridge.getMapValue(a, "title", 0));
final seriesSlug = MBridge.regExp(
MBridge.getMapValue(a, "series_slug", 0), "-\\d+", "", 0, 0);
urls.add("/series/$seriesSlug");
}
manga.urls = urls;
manga.images = images;
manga.names = names;
return manga;
}
getLatestUpdatesManga(MangaModel manga) async {
final headers = getHeader(manga.baseUrl);
final url = "${manga.apiUrl}/series/querysearch";
final body = {
"page": manga.page,
"order": "desc",
"order_by": "latest",
"series_status": "Ongoing",
"series_type": "Comic"
};
final data = {
"url": url,
"headers": headers,
"sourceId": manga.sourceId,
"body": body
};
final res = await MBridge.http(json.encode(data), 1);
if (res.isEmpty) {
return manga;
}
List<String> jsonList = [];
List<String> names = [];
List<String> urls = [];
List<String> images = [];
if (res.startsWith("{")) {
jsonList = MBridge.jsonPathToList(res, r'$.data[*]');
} else {
jsonList = MBridge.jsonDecodeToList(res);
}
for (var a in jsonList) {
final thumbnail = MBridge.getMapValue(a, "thumbnail", 0);
if (thumbnail.startsWith("https://")) {
images.add(thumbnail);
} else {
images.add("${manga.apiUrl}/cover/$thumbnail");
}
names.add(MBridge.getMapValue(a, "title", 0));
final seriesSlug = MBridge.regExp(
MBridge.getMapValue(a, "series_slug", 0), "-\\d+", "", 0, 0);
urls.add("/series/$seriesSlug");
}
manga.urls = urls;
manga.images = images;
manga.names = names;
return manga;
}
getMangaDetail(MangaModel manga) async {
String currentSlug = MBridge.listParse(manga.link.split('/'), 2)[0];
final headers = getHeader(manga.baseUrl);
final url = "${manga.apiUrl}/series/$currentSlug";
final data = {"url": url, "headers": headers};
final res = await MBridge.http(json.encode(data), 0);
if (res.isEmpty) {
return manga;
}
manga.author = MBridge.getMapValue(res, "author", 0);
manga.description = MBridge.getMapValue(res, "description", 0);
manga.genre =
MBridge.jsonPathToString(res, r"$.tags[*].name", "._").split("._");
final chapters = MBridge.jsonPathToList(res, r"$.chapters[*]");
List<String> chapterTitles = [];
List<String> chapterUrls = [];
List<String> chapterDates = [];
for (var chapter in chapters) {
final chapterName = MBridge.getMapValue(chapter, "chapter_name", 0);
final chapterSlug = MBridge.getMapValue(chapter, "chapter_slug", 0);
final chapterId = MBridge.getMapValue(chapter, "id", 0);
final createdAt = MBridge.getMapValue(chapter, "created_at", 0);
chapterUrls.add("/series/$currentSlug/$chapterSlug#$chapterId");
chapterTitles.add(chapterName);
chapterDates.add(createdAt);
}
manga.urls = chapterUrls;
manga.names = chapterTitles;
manga.chaptersDateUploads = MBridge.listParse(
MBridge.listParseDateTime(
chapterDates, manga.dateFormat, manga.dateFormatLocale),
0);
return manga;
}
getChapterUrl(MangaModel manga) async {
String chapterId = MBridge.listParse(manga.link.split('#'), 2)[0];
final headers = getHeader(manga.baseUrl);
final url = "${manga.apiUrl}/series/chapter/$chapterId";
final data = {"url": url, "headers": headers};
final res = await MBridge.http(json.encode(data), 0);
if (res.isEmpty) {
return [];
}
final pages = MBridge.jsonPathToList(res, r"$.content.images[*]");
List<String> pageUrls = [];
for (var u in pages) {
final url = u.replaceAll('"', "");
if (url.startsWith("http")) {
pageUrls.add(url);
} else {
pageUrls.add("${manga.apiUrl}/$url");
}
}
return pageUrls;
}
Map<String, String> getHeader(String url) {
final headers = {
'Origin': url,
'Referer': '$url/',
'Accept': 'application/json, text/plain, */*',
'Content-Type': 'application/json'
};
return headers;
}

View File

@@ -0,0 +1,34 @@
import '../../../model/source.dart';
const heancmsVersion = "0.0.1";
const heancmsSourceCodeUrl =
"https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/manga/multisrc/heancms/heancms-v$heancmsVersion.dart";
const defaultDateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ";
const defaultDateFormatLocale = "en";
List<Source> get heanCmsSourcesList => _heanCmsSourcesList;
List<Source> _heanCmsSourcesList = [
Source(
name: "YugenMangas",
baseUrl: "https://yugenmangas.net",
apiUrl: "https://api.yugenmangas.net",
lang: "es",
typeSource: "heancms",
isNsfw: true,
iconUrl: '',
sourceCodeUrl: heancmsSourceCodeUrl,
version: heancmsVersion,
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale),
Source(
name: "OmegaScans",
baseUrl: "https://omegascans.org",
apiUrl: "https://api.omegascans.org",
lang: "en",
typeSource: "heancms",
isNsfw: true,
iconUrl: '',
sourceCodeUrl: heancmsSourceCodeUrl,
version: heancmsVersion,
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale),
];

View File

@@ -0,0 +1,283 @@
import 'dart:convert';
import 'package:bridge_lib/bridge_lib.dart';
getPopularManga(MangaModel manga) async {
final url = "${manga.baseUrl}/manga/page/${manga.page}/?m_orderby=views";
final data = {"url": url, "headers": null, "sourceId": manga.sourceId};
final res = await MBridge.http(json.encode(data), 0);
if (res.isEmpty) {
return manga;
}
manga.urls = MBridge.xpath(res, '//*[@class^="post-title"]/h3/a/@href', '-.')
.split("-.");
String images =
MBridge.xpath(res, '//*[@id^="manga-item"]/a/img/@data-src', '-.');
if (images.isEmpty) {
images =
MBridge.xpath(res, '//*[@id^="manga-item"]/a/img/@data-lazy-src', '-.');
if (images.isEmpty) {
images = MBridge.xpath(res, '//*[@id^="manga-item"]/a/img/@srcset', '-.');
if (images.isEmpty) {
images = MBridge.xpath(res, '//*[@id^="manga-item"]/a/img/@src', '-.');
}
}
}
manga.images = images.split("-.");
manga.names =
MBridge.xpath(res, '//*[@id^="manga-item"]/a/@title', '-.').split("-.");
return manga;
}
getMangaDetail(MangaModel manga) async {
final statusList = [
{
"OnGoing": 0,
"Продолжается": 0,
"Updating": 0,
"Em Lançamento": 0,
"Em lançamento": 0,
"Em andamento": 0,
"Em Andamento": 0,
"En cours": 0,
"Ativo": 0,
"Lançando": 0,
"Đang Tiến Hành": 0,
"Devam Ediyor": 0,
"Devam ediyor": 0,
"In Corso": 0,
"In Arrivo": 0,
"مستمرة": 0,
"مستمر": 0,
"En Curso": 0,
"En curso": 0,
"Emision": 0,
"En marcha": 0,
"Publicandose": 0,
"En emision": 0,
"连载中": 0,
"Completed": 1,
"Completo": 1,
"Completado": 1,
"Concluído": 1,
"Concluido": 1,
"Finalizado": 1,
"Terminé": 1,
"Hoàn Thành": 1,
"مكتملة": 1,
"مكتمل": 1,
"已完结": 1,
"On Hold": 2,
"Pausado": 2,
"En espera": 2,
"Canceled": 3,
"Cancelado": 3,
}
];
final datas = {
"url": manga.link,
"headers": null,
"sourceId": manga.sourceId
};
final res = await MBridge.http(json.encode(datas), 0);
if (res.isEmpty) {
return manga;
}
manga.author =
MBridge.querySelectorAll(res, "div.author-content > a", 0, "", 0, 0, "");
manga.description = MBridge.querySelectorAll(
res,
"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",
0,
"",
0,
0,
"");
manga.imageUrl =
MBridge.querySelectorAll(res, "div.summary_image img", 2, "", 2, 1, "");
final mangaId = MBridge.querySelectorAll(
res, "div[id^=manga-chapters-holder]", 3, "data-id", 0, 1, "");
manga.status = MBridge.parseStatus(
MBridge.querySelectorAll(res, "div.summary-content", 0, "", 0, 2, ""),
statusList);
manga.genre =
MBridge.querySelectorAll(res, "div.genres-content a", 0, "", 0, 0, "-.")
.split("-.");
final baseUrl = "${manga.baseUrl}/";
final headers = {
"Referer": baseUrl,
"Content-Type": "application/x-www-form-urlencoded",
"X-Requested-With": "XMLHttpRequest"
};
final url =
"${baseUrl}wp-admin/admin-ajax.php?action=manga_get_chapters&manga=$mangaId";
final datasP = {"url": url, "headers": headers, "sourceId": manga.sourceId};
String resP = await MBridge.http(json.encode(datasP), 1);
if (resP == "400") {
final urlP = "${manga.link}ajax/chapters";
final datasP = {
"url": urlP,
"headers": headers,
"sourceId": manga.sourceId
};
resP = await MBridge.http(json.encode(datasP), 1);
}
manga.urls = MBridge.xpath(resP, "//li/a/@href", '-.').split("-.");
List<dynamic> chaptersNames =
MBridge.xpath(resP, "//li/a/text()", '-.').split("-.");
List<dynamic> dateF =
MBridge.xpath(resP, "//li/span/i/text()", '-.').split("-.");
if (MBridge.xpath(resP, "//li/a/text()", "").isEmpty) {
final resWebview = await MBridge.getHtmlViaWebview(manga.link,
"//*[@id='manga-chapters-holder']/div[2]/div/ul/li/a/@href");
manga.urls = MBridge.xpath(resWebview,
"//*[@id='manga-chapters-holder']/div[2]/div/ul/li/a/@href", '-.')
.split("-.");
chaptersNames = MBridge.xpath(resWebview,
"//*[@id='manga-chapters-holder']/div[2]/div/ul/li/a/text()", '-.')
.split("-.");
dateF = MBridge.xpath(
resWebview,
"//*[@id='manga-chapters-holder']/div[2]/div/ul/li/span/i/text()",
'-.')
.split("-.");
}
manga.names = chaptersNames;
List<String> chapterDate = [];
if (dateF.length == chaptersNames.length) {
manga.chaptersDateUploads = MBridge.listParseDateTime(
dateF, manga.dateFormat, manga.dateFormatLocale);
} else if (dateF.length < chaptersNames.length) {
final length = chaptersNames.length - dateF.length;
String date = "${DateTime.now().millisecondsSinceEpoch}";
for (var i = 0; i < length - 1; i++) {
date += "--..${DateTime.now().millisecondsSinceEpoch}";
}
final dateFF = MBridge.listParseDateTime(
dateF, manga.dateFormat, manga.dateFormatLocale);
List<String> chapterDate = MBridge.listParse(date.split('--..'), 0);
for (var date in dateFF) {
chapterDate.add(date);
}
manga.chaptersDateUploads = chapterDate;
}
return manga;
}
getChapterUrl(MangaModel manga) async {
final datas = {
"url": manga.link,
"headers": null,
"sourceId": manga.sourceId
};
final res = await MBridge.http(json.encode(datas), 0);
if (res.isEmpty) {
return [];
}
final pagesSelectorRes = MBridge.querySelector(
res,
"div.page-break, li.blocks-gallery-item, .reading-content, .text-left img",
1,
"");
final imgs =
MBridge.querySelectorAll(pagesSelectorRes, "img", 2, "", 2, 0, '-.')
.split('-.');
List<dynamic> pageUrls = [];
if (imgs.length == 1) {
final pages = MBridge.querySelector(res, "#single-pager", 2, "");
final pagesNumber =
MBridge.querySelectorAll(pages, "option", 2, "", 0, 0, '-.')
.split('-.');
for (var i = 0; i < pagesNumber.length; i++) {
final val = i + 1;
if (i.toString().length == 1) {
pageUrls.add(
MBridge.querySelectorAll(pagesSelectorRes, "img", 2, "", 2, 0, "")
.replaceAll("01", '0$val'));
} else {
pageUrls.add(
MBridge.querySelectorAll(pagesSelectorRes, "img", 2, "", 2, 0, "")
.replaceAll("01", val.toString()));
}
}
} else {
return imgs;
}
return pageUrls;
}
getLatestUpdatesManga(MangaModel manga) async {
final url = "${manga.baseUrl}/manga/page/${manga.page}/?m_orderby=latest";
final datas = {"url": url, "headers": null, "sourceId": manga.sourceId};
final res = await MBridge.http(json.encode(datas), 0);
if (res.isEmpty) {
return manga;
}
manga.urls = MBridge.xpath(res, '//*[@class^="post-title"]/h3/a/@href', '-.')
.split("-.");
String images =
MBridge.xpath(res, '//*[@id^="manga-item"]/a/img/@data-src', '-.');
if (images.isEmpty) {
images =
MBridge.xpath(res, '//*[@id^="manga-item"]/a/img/@data-lazy-src', '-.');
if (images.isEmpty) {
images = MBridge.xpath(res, '//*[@id^="manga-item"]/a/img/@srcset', '-.');
if (images.isEmpty) {
images = MBridge.xpath(res, '//*[@id^="manga-item"]/a/img/@src', '-.');
}
}
}
manga.images = images.split("-.");
manga.names =
MBridge.xpath(res, '//*[@id^="manga-item"]/a/@title', '-.').split("-.");
return manga;
}
searchManga(MangaModel manga) async {
final urll = "${manga.baseUrl}/?s=${manga.query}&post_type=wp-manga";
final datas = {"url": urll, "headers": null, "sourceId": manga.sourceId};
final res = await MBridge.http(json.encode(datas), 0);
if (res.isEmpty) {
return manga;
}
manga.urls =
MBridge.xpath(res, '//*[@class^="tab-thumb c-image-hover"]/a/@href', '-.')
.split("-.");
String images = MBridge.xpath(
res, '//*[@class^="tab-thumb c-image-hover"]/a/img/@data-src', '-.');
if (images.isEmpty) {
images = MBridge.xpath(res,
'//*[@class^="tab-thumb c-image-hover"]/a/img/@data-lazy-src', '-.');
if (images.isEmpty) {
images = MBridge.xpath(
res, '//*[@class^="tab-thumb c-image-hover"]/a/img/@srcset', '-.');
if (images.isEmpty) {
images = MBridge.xpath(
res, '//*[@class^="tab-thumb c-image-hover"]/a/img/@src', '-.');
}
}
}
manga.images = images.split("-.");
manga.names = MBridge.xpath(
res, '//*[@class^="tab-thumb c-image-hover"]/a/@title', '-.')
.split("-.");
return manga;
}
Map<String, String> getHeader(String url) {
final headers = {
"Referer": "$url/",
};
return headers;
}

View File

@@ -0,0 +1,340 @@
import '../../../model/source.dart';
const madaraVersion = "0.0.11";
const madaraSourceCodeUrl =
"https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/manga/multisrc/madara/madara-v$madaraVersion.dart";
const defaultDateFormat = "MMMM dd, yyyy";
const defaultDateFormatLocale = "en_US";
List<Source> get madaraSourcesList => _madaraSourcesList;
List<Source> _madaraSourcesList = [
Source(
name: "FR-Scan",
baseUrl: "https://fr-scan.com",
lang: "fr",
typeSource: "madara",
iconUrl: '',
dateFormat: "MMMM d, yyyy",
dateFormatLocale: "fr",
version: madaraVersion,
sourceCodeUrl: madaraSourceCodeUrl),
Source(
name: "AstralManga",
baseUrl: "https://astral-manga.fr",
lang: "fr",
typeSource: "madara",
iconUrl: '',
dateFormat: "dd/mm/yyyy",
dateFormatLocale: "fr",
version: madaraVersion,
sourceCodeUrl: madaraSourceCodeUrl),
Source(
name: "Akuma no Tenshi",
baseUrl: "https://akumanotenshi.com",
lang: "tr",
typeSource: "madara",
iconUrl: '',
dateFormat: "dd/MM/yyyy",
dateFormatLocale: "pt-BR",
version: madaraVersion,
sourceCodeUrl: madaraSourceCodeUrl),
Source(
name: "Adult Webtoon",
baseUrl: "https://adultwebtoon.com",
lang: "en",
typeSource: "madara",
iconUrl: '',
isNsfw: true,
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: madaraVersion,
sourceCodeUrl: madaraSourceCodeUrl),
Source(
name: "ArazNovel",
baseUrl: "https://www.araznovel.com",
lang: "tr",
typeSource: "madara",
iconUrl: '',
dateFormat: "d MMMM yyyy",
dateFormatLocale: "en",
version: madaraVersion,
sourceCodeUrl: madaraSourceCodeUrl),
Source(
name: "BestManga",
baseUrl: "https://bestmanga.club",
lang: "ru",
typeSource: "madara",
iconUrl: '',
dateFormat: "dd.MM.yyyy",
dateFormatLocale: "ru",
version: madaraVersion,
sourceCodeUrl: madaraSourceCodeUrl),
Source(
name: "Chibi Manga",
baseUrl: "https://www.cmreader.info",
lang: "en",
typeSource: "madara",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: madaraVersion,
sourceCodeUrl: madaraSourceCodeUrl),
Source(
name: "EvaScans",
baseUrl: "https://evascans.com",
lang: "tr",
typeSource: "madara",
iconUrl: '',
dateFormat: "MMM d, yyy",
dateFormatLocale: "tr",
version: madaraVersion,
sourceCodeUrl: madaraSourceCodeUrl),
Source(
name: "Final Scans",
baseUrl: "https://finalscans.com",
lang: "pt-br",
typeSource: "madara",
iconUrl: '',
isNsfw: true,
dateFormat: "MMMM d, yyyy",
dateFormatLocale: "pt-BR",
version: madaraVersion,
sourceCodeUrl: madaraSourceCodeUrl),
Source(
name: "Glory Manga",
baseUrl: "https://glorymanga.com",
lang: "tr",
typeSource: "madara",
iconUrl: '',
dateFormat: "dd/MM/yyy",
dateFormatLocale: "tr",
version: madaraVersion,
sourceCodeUrl: madaraSourceCodeUrl),
Source(
name: "Its Your Right Manhua",
baseUrl: "https://itsyourightmanhua.com/",
lang: "en",
typeSource: "madara",
iconUrl: '',
dateFormat: "MMMM d, yyyy",
dateFormatLocale: defaultDateFormatLocale,
version: madaraVersion,
sourceCodeUrl: madaraSourceCodeUrl),
Source(
name: "Kami Sama Explorer",
baseUrl: "https://leitor.kamisama.com.br",
lang: "pt-br",
typeSource: "madara",
iconUrl: '',
dateFormat: "dd 'de' MMMM 'de' yyyy",
dateFormatLocale: "pt-BR",
version: madaraVersion,
sourceCodeUrl: madaraSourceCodeUrl),
Source(
name: "KSGroupScans",
baseUrl: "https://ksgroupscans.com",
lang: "en",
typeSource: "madara",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: madaraVersion,
sourceCodeUrl: madaraSourceCodeUrl),
Source(
name: "LHTranslation",
baseUrl: "https://lhtranslation.net",
lang: "en",
typeSource: "madara",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: madaraVersion,
sourceCodeUrl: madaraSourceCodeUrl),
Source(
name: "Lolicon",
baseUrl: "https://lolicon.mobi",
lang: "en",
isNsfw: true,
typeSource: "madara",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: madaraVersion,
sourceCodeUrl: madaraSourceCodeUrl),
Source(
name: "MangaVisa",
baseUrl: "https://mangavisa.com",
lang: "en",
typeSource: "madara",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: madaraVersion,
sourceCodeUrl: madaraSourceCodeUrl),
Source(
name: "Manga District",
baseUrl: "https://mangadistrict.com",
lang: "tr",
typeSource: "madara",
iconUrl: '',
isNsfw: true,
dateFormat: "MMMM d, yyyy",
dateFormatLocale: defaultDateFormatLocale,
version: madaraVersion,
sourceCodeUrl: madaraSourceCodeUrl),
Source(
name: "MangaFreak.online",
baseUrl: "https://mangafreak.online",
lang: "en",
typeSource: "madara",
iconUrl: '',
dateFormat: "d MMMM، yyy",
dateFormatLocale: defaultDateFormatLocale,
version: madaraVersion,
sourceCodeUrl: madaraSourceCodeUrl),
Source(
name: "MangaGreat",
baseUrl: "https://mangagreat.com",
lang: "en",
typeSource: "madara",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: madaraVersion,
sourceCodeUrl: madaraSourceCodeUrl),
Source(
name: "Manga Read",
baseUrl: "https://mangaread.co",
lang: "en",
typeSource: "madara",
iconUrl: '',
dateFormat: "yyyy-MM-dd",
dateFormatLocale: defaultDateFormatLocale,
version: madaraVersion,
sourceCodeUrl: madaraSourceCodeUrl),
Source(
name: "MangaRolls",
baseUrl: "https://mangarolls.com",
lang: "en",
typeSource: "madara",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: madaraVersion,
sourceCodeUrl: madaraSourceCodeUrl),
Source(
name: "Manga Şehri",
baseUrl: "https://mangasehri.com",
lang: "tr",
typeSource: "madara",
iconUrl: '',
dateFormat: "dd/MM/yyy",
dateFormatLocale: "tr",
version: madaraVersion,
sourceCodeUrl: madaraSourceCodeUrl),
Source(
name: "Mangasushi",
baseUrl: "https://mangasushi.org",
lang: "en",
typeSource: "madara",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: madaraVersion,
sourceCodeUrl: madaraSourceCodeUrl),
Source(
name: "Manhwa68",
baseUrl: "https://manhwa68.com",
lang: "en",
isNsfw: true,
typeSource: "madara",
iconUrl: '',
dateFormat: "MMMM d, yyyy",
dateFormatLocale: defaultDateFormatLocale,
version: madaraVersion,
sourceCodeUrl: madaraSourceCodeUrl),
Source(
name: "Milftoon",
baseUrl: "https://milftoon.xxx",
lang: "en",
isNsfw: true,
typeSource: "madara",
iconUrl: '',
dateFormat: "d MMMM, yyyy",
dateFormatLocale: defaultDateFormatLocale,
version: madaraVersion,
sourceCodeUrl: madaraSourceCodeUrl),
Source(
name: "NovelCrow",
baseUrl: "https://novelcrow.com",
lang: "en",
typeSource: "madara",
iconUrl: '',
isNsfw: true,
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: madaraVersion,
sourceCodeUrl: madaraSourceCodeUrl),
Source(
name: "Rio2 Manga",
baseUrl: "https://rio2manga.com",
lang: "en",
typeSource: "madara",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: madaraVersion,
sourceCodeUrl: madaraSourceCodeUrl),
Source(
name: "Romantik Manga",
baseUrl: "https://rio2manga.com",
lang: "tr",
typeSource: "madara",
iconUrl: '',
dateFormat: "MMMM d, yyyy",
dateFormatLocale: defaultDateFormatLocale,
version: madaraVersion,
sourceCodeUrl: madaraSourceCodeUrl),
Source(
name: "Taurus Fansub",
baseUrl: "https://tatakaescan.com",
lang: "es",
typeSource: "madara",
iconUrl: '',
dateFormat: "dd/MM/yyy",
dateFormatLocale: "es",
version: madaraVersion,
sourceCodeUrl: madaraSourceCodeUrl),
Source(
name: "Tortuga Ceviri",
baseUrl: "https://tortuga-ceviri.com",
lang: "tr",
typeSource: "madara",
iconUrl: '',
dateFormat: "MMMM d, yyyy",
dateFormatLocale: "tr",
version: madaraVersion,
sourceCodeUrl: madaraSourceCodeUrl),
Source(
name: "Yuri Verso",
baseUrl: "https://yuri.live",
lang: "pt-br",
typeSource: "madara",
iconUrl: '',
dateFormat: "dd/MM/yyyy",
dateFormatLocale: "pt-BR",
version: madaraVersion,
sourceCodeUrl: madaraSourceCodeUrl),
Source(
name: "Zero Scan",
baseUrl: "https://zeroscan.com.br",
lang: "pt-br",
isNsfw: true,
typeSource: "madara",
iconUrl: '',
dateFormat: "dd/MM/yyyy",
dateFormatLocale: "pt-BR",
version: madaraVersion,
sourceCodeUrl: madaraSourceCodeUrl),
];

View File

@@ -0,0 +1,207 @@
import 'dart:convert';
import 'package:bridge_lib/bridge_lib.dart';
getPopularManga(MangaModel manga) async {
final url = "${manga.baseUrl}/manga/?page=${manga.page}&order=popular";
final data = {"url": url, "headers": null, "sourceId": manga.sourceId};
final res = await MBridge.http(json.encode(data), 0);
if (res.isEmpty) {
return manga;
}
manga.urls =
MBridge.xpath(res, '//*[ @class="imgu" or @class="bsx"]/a/@href', '._')
.split('._');
manga.names =
MBridge.xpath(res, '//*[ @class="imgu" or @class="bsx"]/a/@title', '._')
.split('._');
manga.images = MBridge.xpath(
res, '//*[ @class="imgu" or @class="bsx"]/a/div[1]/img/@src', '._')
.split('._');
return manga;
}
getLatestUpdatesManga(MangaModel manga) async {
final url = "${manga.baseUrl}/manga/?page=${manga.page}&order=update";
final data = {"url": url, "headers": null, "sourceId": manga.sourceId};
final res = await MBridge.http(json.encode(data), 0);
if (res.isEmpty) {
return manga;
}
manga.urls =
MBridge.xpath(res, '//*[ @class="imgu" or @class="bsx"]/a/@href', '._')
.split('._');
manga.names =
MBridge.xpath(res, '//*[ @class="imgu" or @class="bsx"]/a/@title', '._')
.split('._');
manga.images = MBridge.xpath(
res, '//*[ @class="imgu" or @class="bsx"]/a/div[1]/img/@src', '._')
.split('._');
return manga;
}
getMangaDetail(MangaModel manga) async {
final statusList = [
{
"مستمرة": 0,
"En curso": 0,
"Ongoing": 0,
"On going": 0,
"Ativo": 0,
"En Cours": 0,
"Berjalan": 0,
"Продолжается": 0,
"Updating": 0,
"Lançando": 0,
"In Arrivo": 0,
"OnGoing": 0,
"Đang tiến hành": 0,
"em lançamento": 0,
"Онгоінг": 0,
"Publishing": 0,
"Curso": 0,
"En marcha": 0,
"Publicandose": 0,
"连载中": 0,
"Devam Ediyor": 0,
"Em Andamento": 0,
"In Corso": 0,
"Güncel": 0,
"Emision": 0,
"En emision": 0,
"مستمر": 0,
"Đã hoàn thành": 1,
"مكتملة": 1,
"Завершено": 1,
"Complété": 1,
"Fini": 1,
"Terminé": 1,
"Tamamlandı": 1,
"Tamat": 1,
"Completado": 1,
"Concluído": 1,
"Finished": 1,
"Completed": 1,
"Completo": 1,
"Concluido": 1,
"已完结": 1,
"Finalizado": 1,
"Completata": 1,
"One-Shot": 1,
"Bitti": 1,
"hiatus": 2,
}
];
final datas = {
"url": manga.link,
"headers": null,
"sourceId": manga.sourceId
};
final res = await MBridge.http(json.encode(datas), 0);
if (res.isEmpty) {
return manga;
}
manga.author = MBridge.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()',
'')
.replaceAll("Autor", "")
.replaceAll("Author", "")
.replaceAll("Auteur", "")
.replaceAll("[Add, ]", "");
manga.description = MBridge.querySelectorAll(
res, ".desc, .entry-content[itemprop=description]", 0, "", 0, 0, "");
final status = MBridge.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()',
'')
.replaceAll("Status", "")
.replaceAll("Estado", "")
.replaceAll("Statut", "");
manga.status = MBridge.parseStatus(status, statusList);
manga.genre = MBridge.xpath(
res,
'//*[@class="gnr" or @class="mgen" or @class="seriestugenre" ]/a/text()',
"-.")
.split("-.");
manga.urls = MBridge.xpath(
res,
'//*[@class="bxcl" or @class="cl" or @class="chbox" or @class="eph-num" or @id="chapterlist"]/div/a[not(@href="#/chapter-{{number}}")]/@href',
"-.")
.split("-.");
manga.names = MBridge.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()',
"-.")
.split("-.");
final chaptersDateUploads = MBridge.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()',
"-.")
.split("-.");
manga.chaptersDateUploads = MBridge.listParseDateTime(
chaptersDateUploads, manga.dateFormat, manga.dateFormatLocale);
return manga;
}
searchManga(MangaModel manga) async {
final url =
"${manga.baseUrl}/manga/?&title=${manga.query}&page=${manga.page}";
final data = {"url": url, "headers": null, "sourceId": manga.sourceId};
final res = await MBridge.http(json.encode(data), 0);
if (res.isEmpty) {
return manga;
}
manga.urls =
MBridge.xpath(res, '//*[ @class="imgu" or @class="bsx"]/a/@href', '._')
.split('._');
manga.names =
MBridge.xpath(res, '//*[ @class="imgu" or @class="bsx"]/a/@title', '._')
.split('._');
manga.images = MBridge.xpath(
res, '//*[ @class="imgu" or @class="bsx"]/a/div[1]/img/@src', '._')
.split('._');
return manga;
}
getChapterUrl(MangaModel manga) async {
final datas = {
"url": manga.link,
"headers": null,
"sourceId": manga.sourceId
};
final res = await MBridge.http(json.encode(datas), 0);
if (res.isEmpty) {
return [];
}
if (manga.source == "Sushi-Scan.fr") {
final pages = MBridge.xpath(res, '//*[@id="readerarea"]/p/img/@src', "._._")
.split("._._");
return pages;
}
List<String> pagesUrl = [];
final pages = MBridge.xpath(res, '//*[@id="readerarea"]/img/@src', "._._")
.split("._._");
if (pages.length == 1) {
final images =
MBridge.regExp(res, "\"images\"\\s*:\\s*(\\[.*?])", "", 1, 1);
final pages = MBridge.jsonDecodeToList(images);
for (var page in pages) {
pagesUrl.add(page);
}
} else {
return pages;
}
return pagesUrl;
}

View File

@@ -0,0 +1,381 @@
import '../../../model/source.dart';
const mangareaderVersion = "0.0.13";
const mangareaderSourceCodeUrl =
"https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/manga/multisrc/mangareader/mangareader-v$mangareaderVersion.dart";
const defaultDateFormat = "MMMM dd, yyyy";
const defaultDateFormatLocale = "en_US";
List<Source> get mangareaderSourcesList => _mangareaderSourcesList;
List<Source> _mangareaderSourcesList = [
Source(
name: "Asura Scans",
baseUrl: "https://www.asurascans.com",
lang: "en",
iconUrl: '',
dateFormat: "MMM d, yyyy",
dateFormatLocale: "en_US",
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "Komik Lab",
baseUrl: "https://komiklab.com",
lang: "en",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "Azure Scans",
baseUrl: "https://azuremanga.com",
lang: "en",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "Cosmic Scans",
baseUrl: "https://cosmicscans.com",
lang: "en",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "CosmicScans.id",
baseUrl: "https://cosmicscans.id",
lang: "id",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "Dojing.net",
baseUrl: "https://dojing.net",
lang: "id",
isNsfw: true,
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "DuniaKomik.id",
baseUrl: "https://duniakomik.id",
lang: "id",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: "id",
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "Gecenin Lordu",
baseUrl: "https://geceninlordu.com",
lang: "tr",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "Infernal Void Scans",
baseUrl: "https://void-scans.com",
lang: "en",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "KataKomik",
baseUrl: "https://katakomik.online",
lang: "id",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "Kanzenin",
baseUrl: "https://kanzenin.xyz",
lang: "id",
isNsfw: true,
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "Komik Station",
baseUrl: "https://komikstation.co",
lang: "id",
iconUrl: '',
dateFormat: defaultDateFormat,
hasCloudflare: true,
dateFormatLocale: "id",
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "KomikMama",
baseUrl: "https://komikmama.co",
lang: "id",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: "id",
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "KumaPoi",
baseUrl: "https://kumapoi.club",
lang: "id",
isNsfw: true,
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: "id",
hasCloudflare: true,
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "Komiku.com",
baseUrl: "https://komiku.com",
lang: "id",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: "id",
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "Legacy Scans",
baseUrl: "https://legacy-scans.com",
lang: "fr",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "Magus Manga",
baseUrl: "https://magusmanga.com",
lang: "ar",
iconUrl: '',
dateFormat: "MMMMM d, yyyy",
dateFormatLocale: "ar",
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "Manga Indo.me",
baseUrl: "https://mangaindo.me",
lang: "id",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "Mangacim",
baseUrl: "https://www.mangacim.com",
lang: "tr",
iconUrl: '',
dateFormat: "MMM d, yyy",
dateFormatLocale: "tr",
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "MangaTale",
baseUrl: "https://mangatale.co",
lang: "id",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: "id",
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "MangaWT",
baseUrl: "https://mangawt.com",
lang: "tr",
iconUrl: '',
dateFormat: "MMM d, yyyy",
dateFormatLocale: "tr",
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
// Source(
// name: "Manhwa Lover",
// baseUrl: "https://manhwalover.com",
// lang: "en",
// isNsfw: true,
// iconUrl: '',
// dateFormat: defaultDateFormat,
// dateFormatLocale: defaultDateFormatLocale,
// version: mangareaderVersion,
// sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "Manhwax",
baseUrl: "https://manhwax.com",
lang: "en",
isNsfw: true,
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "MELOKOMIK",
baseUrl: "https://melokomik.xyz",
lang: "id",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: "id",
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "Mihentai",
baseUrl: "https://mihentai.com",
lang: "all",
isNsfw: true,
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "Mundo Mangá-Kun",
baseUrl: "https://mundomangakun.com.br",
lang: "pt-BR",
isNsfw: true,
iconUrl: '',
dateFormat: "MMMMM dd, yyyy",
dateFormatLocale: "pt-BR",
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "Origami Orpheans",
baseUrl: "https://origami-orpheans.com.br",
lang: "pt-BR",
iconUrl: '',
dateFormat: "MMMMM dd, yyyy",
dateFormatLocale: "pt-BR",
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "PhenixScans",
baseUrl: "https://phenixscans.fr",
lang: "fr",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: "fr",
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "Pi Scans",
baseUrl: "https://piscans.in",
lang: "id",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "Raiki Scan",
baseUrl: "https://raikiscan.com",
lang: "es",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "Raven Scans",
baseUrl: "https://ravenscans.com",
lang: "en",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "Shadow Mangas",
baseUrl: "https://shadowmangas.com",
lang: "es",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: "es",
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "Surya Scans",
baseUrl: "https://suryascans.com",
lang: "en",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "Sushi-Scans",
baseUrl: "https://sushiscan.fr",
lang: "fr",
iconUrl: '',
dateFormat: defaultDateFormat,
hasCloudflare: true,
dateFormatLocale: "fr",
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
// Source(
// name: "Sushi-Scan",
// baseUrl: "https://sushiscan.net",
// lang: "fr",
// iconUrl: '',
// dateFormat: defaultDateFormat,
// hasCloudflare: true,
// dateFormatLocale: "fr",
// version: mangareaderVersion,
// sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "Tarot Scans",
baseUrl: "https://www.tarotscans.com",
lang: "tr",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: "tr",
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "TukangKomik",
baseUrl: "https://tukangkomik.id",
lang: "id",
iconUrl: '',
dateFormat: "MMM d, yyyy",
dateFormatLocale: "tr",
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "TurkToon",
baseUrl: "https://turktoon.com",
lang: "tr",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "Uzay Manga",
baseUrl: "https://uzaymanga.com",
lang: "tr",
iconUrl: '',
dateFormat: "MMM d, yyyy",
dateFormatLocale: "tr",
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
Source(
name: "xCaliBR Scans",
baseUrl: "https://xcalibrscans.com",
lang: "en",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: mangareaderVersion,
sourceCodeUrl: mangareaderSourceCodeUrl),
];

View File

@@ -0,0 +1,173 @@
import 'dart:convert';
import 'package:bridge_lib/bridge_lib.dart';
searchManga(MangaModel manga) async {
final url = "${manga.baseUrl}/search?query=${manga.query}";
final data = {"url": url, "headers": null, "sourceId": manga.sourceId};
final res = await MBridge.http(json.encode(data), 0);
if (res.isEmpty) {
return manga;
}
final jsonList = MBridge.jsonPathToList(res, r'$.suggestions[*]');
List<String> urls = [];
List<String> names = [];
List<String> images = [];
for (var da in jsonList) {
final value = MBridge.getMapValue(da, "value", 0);
final data = MBridge.getMapValue(da, "data", 0);
if (manga.source == 'Scan VF') {
urls.add('${manga.baseUrl}/$data');
} else {
urls.add('${manga.baseUrl}/manga/$data');
}
names.add(value);
if (manga.source == "Manga-FR") {
images.add("${manga.baseUrl}/uploads/manga/$data.jpg");
} else {
images
.add("${manga.baseUrl}/uploads/manga/$data/cover/cover_250x350.jpg");
}
}
manga.names = names;
manga.urls = urls;
manga.images = images;
return manga;
}
getPopularManga(MangaModel manga) async {
final url =
"${manga.baseUrl}/filterList?page=${manga.page}&sortBy=views&asc=false";
final data = {"url": url, "headers": null, "sourceId": manga.sourceId};
final res = await MBridge.http(json.encode(data), 0);
if (res.isEmpty) {
return manga;
}
manga.urls =
MBridge.xpath(res, '//*[ @class="chart-title"]/@href', '._').split('._');
manga.names =
MBridge.xpath(res, '//*[ @class="chart-title"]/text()', '._').split('._');
List<String> images = [];
for (var url in manga.urls) {
if (manga.source == "Manga-FR") {
images.add(
"${manga.baseUrl}/uploads/manga/${MBridge.listParse(MBridge.stringParse(url).split('/'), 2)[0]}.jpg");
} else {
images.add(
"${manga.baseUrl}/uploads/manga/${MBridge.listParse(MBridge.stringParse(url).split('/'), 2)[0]}/cover/cover_250x350.jpg");
}
}
manga.images = images;
return manga;
}
getMangaDetail(MangaModel manga) async {
final statusList = [
{
"complete": 1,
"complet": 1,
"completo": 1,
"zakończone": 1,
"concluído": 1,
"مكتملة": 1,
"ongoing": 0,
"en cours": 0,
"em lançamento": 0,
"prace w toku": 0,
"ativo": 0,
"مستمرة": 0,
"em andamento": 0
}
];
final datas = {
"url": manga.link,
"headers": null,
"sourceId": manga.sourceId
};
final res = await MBridge.http(json.encode(datas), 0);
if (res.isEmpty) {
return manga;
}
manga.author = MBridge.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()',
'');
final status = MBridge.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()',
'');
manga.status = MBridge.parseStatus(status, statusList);
manga.description = MBridge.xpath(
res, '//*[@class="well" or @class="manga well"]/p/text()', '');
manga.genre = MBridge.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()',
'')
.split(',');
manga.names =
MBridge.xpath(res, '//*[@class="chapter-title-rtl"]/a/text()', "-.")
.split("-.");
manga.urls =
MBridge.xpath(res, '//*[@class="chapter-title-rtl"]/a/@href', "-.")
.split("-.");
final date =
MBridge.xpath(res, '//*[@class="date-chapter-title-rtl"]/text()', "-.")
.split("-.");
manga.chaptersDateUploads =
MBridge.listParseDateTime(date, "d MMM. yyyy", "en_US");
return manga;
}
getLatestUpdatesManga(MangaModel manga) async {
final url = "${manga.baseUrl}/latest-release?page=${manga.page}";
final data = {"url": url, "headers": null, "sourceId": manga.sourceId};
final res = await MBridge.http(json.encode(data), 0);
if (res.isEmpty) {
return manga;
}
manga.urls = MBridge.xpath(res, '//*[@class="manga-item"]/h3/a/@href', '._')
.split('._');
manga.names = MBridge.xpath(res, '//*[@class="manga-item"]/h3/a/text()', '._')
.split('._');
List<String> images = [];
for (var url in manga.urls) {
if (manga.source == "Manga-FR") {
images.add(
"${manga.baseUrl}/uploads/manga/${MBridge.listParse(MBridge.stringParse(url).split('/'), 2)[0]}.jpg");
} else {
images.add(
"${manga.baseUrl}/uploads/manga/${MBridge.listParse(MBridge.stringParse(url).split('/'), 2)[0]}/cover/cover_250x350.jpg");
}
}
manga.images = images;
return manga;
}
getChapterUrl(MangaModel manga) async {
final datas = {
"url": manga.link,
"headers": null,
"sourceId": manga.sourceId
};
final res = await MBridge.http(json.encode(datas), 0);
if (res.isEmpty) {
return [];
}
List<String> pagesUrl = [];
final pages = MBridge.listParse(
MBridge.xpath(res,
'//*[@id="all"]/img[@class="img-responsive"]/@data-src', "._._")
.split("._._"),
0);
for (var page in pages) {
if (page.startsWith('//')) {
pagesUrl.add(page.replaceAll('//', 'https://'));
} else {
pagesUrl.add(page);
}
}
return pagesUrl;
}

View File

@@ -0,0 +1,101 @@
import '../../../model/source.dart';
const mmrcmsVersion = "0.0.1";
const mmrcmsSourceCodeUrl =
"https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/manga/multisrc/mmrcms/mmrcms-v$mmrcmsVersion.dart";
const defaultDateFormat = "d MMM. yyyy";
const defaultDateFormatLocale = "en_US";
List<Source> get mmrcmsSourcesList => _mmrcmsSourcesList;
List<Source> _mmrcmsSourcesList = [
Source(
name: "Scan VF",
baseUrl: "https://www.scan-vf.net",
lang: "fr",
typeSource: "mmrcms",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: mmrcmsVersion,
sourceCodeUrl: mmrcmsSourceCodeUrl,
),
Source(
name: "Komikid",
baseUrl: "https://www.komikid.com",
lang: "id",
typeSource: "mmrcms",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: mmrcmsVersion,
sourceCodeUrl: mmrcmsSourceCodeUrl,
),
Source(
name: "MangaID",
baseUrl: "https://mangaid.click",
lang: "id",
typeSource: "mmrcms",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: mmrcmsVersion,
sourceCodeUrl: mmrcmsSourceCodeUrl,
),
Source(
name: "Jpmangas",
baseUrl: "https://jpmangas.cc",
lang: "fr",
typeSource: "mmrcms",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: mmrcmsVersion,
sourceCodeUrl: mmrcmsSourceCodeUrl,
),
Source(
name: "مانجا اون لاين",
baseUrl: "https://onma.top",
lang: "ar",
typeSource: "mmrcms",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: mmrcmsVersion,
sourceCodeUrl: mmrcmsSourceCodeUrl,
),
Source(
name: "Read Comics Online",
baseUrl: "https://readcomicsonline.ru",
lang: "en",
typeSource: "mmrcms",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: mmrcmsVersion,
sourceCodeUrl: mmrcmsSourceCodeUrl,
),
Source(
name: "Lelscan-VF",
baseUrl: "https://www.lelscanvf.cc/",
lang: "fr",
typeSource: "mmrcms",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: mmrcmsVersion,
sourceCodeUrl: mmrcmsSourceCodeUrl,
),
Source(
name: "Manga-FR",
baseUrl: "https://manga-fr.me",
lang: "fr",
typeSource: "mmrcms",
iconUrl: '',
dateFormat: defaultDateFormat,
dateFormatLocale: defaultDateFormatLocale,
version: mmrcmsVersion,
sourceCodeUrl: mmrcmsSourceCodeUrl,
),
];