mirror of
https://github.com/kodjodevf/mangayomi-extensions.git
synced 2026-02-16 20:00:30 +00:00
Update
This commit is contained in:
BIN
icons/mangayomi-fr-perfscan.png
Normal file
BIN
icons/mangayomi-fr-perfscan.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.0 KiB |
BIN
icons/mangayomi-pt-gloriousscan.png
Normal file
BIN
icons/mangayomi-pt-gloriousscan.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.7 KiB |
BIN
icons/mangayomi-pt-reaperscans.png
Normal file
BIN
icons/mangayomi-pt-reaperscans.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.6 KiB |
File diff suppressed because one or more lines are too long
@@ -59,6 +59,7 @@ getPopularManga(MangaModel manga) async {
|
|||||||
"sourceId": manga.sourceId,
|
"sourceId": manga.sourceId,
|
||||||
"body": body
|
"body": body
|
||||||
};
|
};
|
||||||
|
|
||||||
res = await MBridge.http('POST', json.encode(data));
|
res = await MBridge.http('POST', json.encode(data));
|
||||||
} else {
|
} else {
|
||||||
final newEndpointUrl = "${manga.apiUrl}/query";
|
final newEndpointUrl = "${manga.apiUrl}/query";
|
||||||
@@ -80,7 +81,6 @@ getPopularManga(MangaModel manga) async {
|
|||||||
};
|
};
|
||||||
print("sssssssssssssssssssss");
|
print("sssssssssssssssssssss");
|
||||||
res = await MBridge.http('GET', json.encode(newEndpointData));
|
res = await MBridge.http('GET', json.encode(newEndpointData));
|
||||||
print(res);
|
|
||||||
}
|
}
|
||||||
if (res.isEmpty) {
|
if (res.isEmpty) {
|
||||||
return manga;
|
return manga;
|
||||||
@@ -136,8 +136,7 @@ getLatestUpdatesManga(MangaModel manga) async {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getMangaDetail(MangaModel manga) async {
|
getMangaDetail(MangaModel manga) async {
|
||||||
String currentSlug = manga.link.split('/').last;
|
String currentSlug = MBridge.substringAfterLast(manga.link, "/");
|
||||||
|
|
||||||
final headers = getHeader(manga.baseUrl);
|
final headers = getHeader(manga.baseUrl);
|
||||||
final url = "${manga.apiUrl}/series/$currentSlug";
|
final url = "${manga.apiUrl}/series/$currentSlug";
|
||||||
final data = {"url": url, "headers": headers};
|
final data = {"url": url, "headers": headers};
|
||||||
@@ -145,23 +144,18 @@ getMangaDetail(MangaModel manga) async {
|
|||||||
if (res.isEmpty) {
|
if (res.isEmpty) {
|
||||||
return manga;
|
return manga;
|
||||||
}
|
}
|
||||||
|
print(res);
|
||||||
manga.author = MBridge.getMapValue(res, "author");
|
manga.author = MBridge.getMapValue(res, "author");
|
||||||
|
|
||||||
manga.description = MBridge.getMapValue(res, "description");
|
manga.description = MBridge.getMapValue(res, "description");
|
||||||
manga.genre =
|
manga.genre =
|
||||||
MBridge.jsonPathToString(res, r"$.tags[*].name", "._").split("._");
|
MBridge.jsonPathToString(res, r"$.tags[*].name", "._").split("._");
|
||||||
|
|
||||||
var chapters = [];
|
|
||||||
if (!useNewQueryEndpoint(manga.source)) {
|
|
||||||
chapters = json.decode(res)["chapters"];
|
|
||||||
} else {
|
|
||||||
final seasons = json.decode(res)["seasons"].first;
|
|
||||||
chapters = seasons["chapters"];
|
|
||||||
}
|
|
||||||
List<String> chapterTitles = [];
|
List<String> chapterTitles = [];
|
||||||
List<String> chapterUrls = [];
|
List<String> chapterUrls = [];
|
||||||
List<String> chapterDates = [];
|
List<String> chapterDates = [];
|
||||||
for (var chapter in chapters) {
|
|
||||||
|
if (!useNewQueryEndpoint(manga.source)) {
|
||||||
|
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"];
|
||||||
final chapterId = chapter["id"];
|
final chapterId = chapter["id"];
|
||||||
@@ -170,6 +164,19 @@ getMangaDetail(MangaModel manga) async {
|
|||||||
chapterTitles.add(chapterName);
|
chapterTitles.add(chapterName);
|
||||||
chapterDates.add(createdAt);
|
chapterDates.add(createdAt);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
final seasons = json.decode(res)["seasons"].first;
|
||||||
|
for (var chapter in seasons["chapters"]) {
|
||||||
|
final chapterName = chapter["chapter_name"];
|
||||||
|
final chapterSlug = chapter["chapter_slug"];
|
||||||
|
final chapterId = chapter["id"];
|
||||||
|
final createdAt = chapter["created_at"];
|
||||||
|
chapterUrls.add("/series/$currentSlug/$chapterSlug#$chapterId");
|
||||||
|
chapterTitles.add(chapterName);
|
||||||
|
chapterDates.add(createdAt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!useNewQueryEndpoint(manga.source)) {
|
if (!useNewQueryEndpoint(manga.source)) {
|
||||||
manga.urls = chapterUrls.reversed.toList();
|
manga.urls = chapterUrls.reversed.toList();
|
||||||
manga.names = chapterTitles.reversed.toList();
|
manga.names = chapterTitles.reversed.toList();
|
||||||
@@ -244,21 +251,17 @@ bool useNewQueryEndpoint(String sourceName) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool useslugStrategy(String sourceName) {
|
bool useslugStrategy(String sourceName) {
|
||||||
List<String> sources = ["YugenMangas", "Reaper Scans"];
|
List<String> sources = ["YugenMangas", "Reaper Scans", "Perf Scan"];
|
||||||
return sources.contains(sourceName);
|
return sources.contains(sourceName);
|
||||||
}
|
}
|
||||||
|
|
||||||
MangaModel mangaModelRes(String res, MangaModel manga) {
|
MangaModel mangaModelRes(String res, MangaModel manga) {
|
||||||
var jsonList = [];
|
|
||||||
List<String> names = [];
|
List<String> names = [];
|
||||||
List<String> urls = [];
|
List<String> urls = [];
|
||||||
List<String> images = [];
|
List<String> images = [];
|
||||||
|
|
||||||
if (res.startsWith("{")) {
|
if (res.startsWith("{")) {
|
||||||
jsonList = json.decode(res)["data"];
|
for (var a in json.decode(res)["data"]) {
|
||||||
} else {
|
|
||||||
jsonList = json.decode(res);
|
|
||||||
}
|
|
||||||
for (var a in jsonList) {
|
|
||||||
String thumbnail = a["thumbnail"];
|
String thumbnail = a["thumbnail"];
|
||||||
if (thumbnail.startsWith("https://")) {
|
if (thumbnail.startsWith("https://")) {
|
||||||
images.add(thumbnail);
|
images.add(thumbnail);
|
||||||
@@ -269,6 +272,20 @@ MangaModel mangaModelRes(String res, MangaModel manga) {
|
|||||||
final seriesSlug = MBridge.regExp(a["series_slug"], "-\\d+", "", 0, 0);
|
final seriesSlug = MBridge.regExp(a["series_slug"], "-\\d+", "", 0, 0);
|
||||||
urls.add("/series/$seriesSlug");
|
urls.add("/series/$seriesSlug");
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
for (var a in json.decode(res)) {
|
||||||
|
String thumbnail = a["thumbnail"];
|
||||||
|
if (thumbnail.startsWith("https://")) {
|
||||||
|
images.add(thumbnail);
|
||||||
|
} else {
|
||||||
|
images.add("${manga.apiUrl}/cover/$thumbnail");
|
||||||
|
}
|
||||||
|
names.add(a["title"]);
|
||||||
|
final seriesSlug = MBridge.regExp(a["series_slug"], "-\\d+", "", 0, 0);
|
||||||
|
urls.add("/series/$seriesSlug");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
manga.urls = urls;
|
manga.urls = urls;
|
||||||
manga.images = images;
|
manga.images = images;
|
||||||
manga.names = names;
|
manga.names = names;
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import '../../../model/source.dart';
|
import '../../../model/source.dart';
|
||||||
import '../../../utils/utils.dart';
|
import '../../../utils/utils.dart';
|
||||||
|
|
||||||
const heancmsVersion = "0.0.2";
|
const heancmsVersion = "0.0.21";
|
||||||
const heancmsSourceCodeUrl =
|
const heancmsSourceCodeUrl =
|
||||||
"https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/manga/multisrc/heancms/heancms-v$heancmsVersion.dart";
|
"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 defaultDateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ";
|
||||||
@@ -11,7 +11,7 @@ List<Source> _heanCmsSourcesList = [
|
|||||||
Source(
|
Source(
|
||||||
name: "YugenMangas",
|
name: "YugenMangas",
|
||||||
baseUrl: "https://yugenmangas.lat",
|
baseUrl: "https://yugenmangas.lat",
|
||||||
apiUrl: "https://api.yugenmangas.lat",
|
apiUrl: "https://api.yugenmangas.net",
|
||||||
lang: "es",
|
lang: "es",
|
||||||
typeSource: "heancms",
|
typeSource: "heancms",
|
||||||
isNsfw: true,
|
isNsfw: true,
|
||||||
@@ -32,40 +32,37 @@ List<Source> _heanCmsSourcesList = [
|
|||||||
version: heancmsVersion,
|
version: heancmsVersion,
|
||||||
dateFormat: defaultDateFormat,
|
dateFormat: defaultDateFormat,
|
||||||
dateFormatLocale: defaultDateFormatLocale),
|
dateFormatLocale: defaultDateFormatLocale),
|
||||||
Source(
|
// Source(
|
||||||
name: "Reaper Scans",
|
// name: "Reaper Scans",
|
||||||
baseUrl: "https://reaperscans.net",
|
// baseUrl: "https://reaperscans.net",
|
||||||
apiUrl: "https://api.reaperscans.net",
|
// apiUrl: "https://api.reaperscans.net",
|
||||||
lang: "pt-BR",
|
// lang: "pt-br",
|
||||||
typeSource: "heancms",
|
// typeSource: "heancms",
|
||||||
isNsfw: true,
|
// iconUrl: getIconUrl("reaperscans", "pt"),
|
||||||
iconUrl: getIconUrl("reaperscans", "pt-BR"),
|
// sourceCodeUrl: heancmsSourceCodeUrl,
|
||||||
sourceCodeUrl: heancmsSourceCodeUrl,
|
// version: heancmsVersion,
|
||||||
version: heancmsVersion,
|
// dateFormat: defaultDateFormat,
|
||||||
dateFormat: defaultDateFormat,
|
// dateFormatLocale: defaultDateFormatLocale),
|
||||||
dateFormatLocale: defaultDateFormatLocale),
|
|
||||||
Source(
|
Source(
|
||||||
name: "Perf Scan",
|
name: "Perf Scan",
|
||||||
baseUrl: "https://perf-scan.fr",
|
baseUrl: "https://perf-scan.fr",
|
||||||
apiUrl: "https://api.perf-scan.fr",
|
apiUrl: "https://api.perf-scan.fr",
|
||||||
lang: "fr",
|
lang: "fr",
|
||||||
typeSource: "heancms",
|
typeSource: "heancms",
|
||||||
isNsfw: true,
|
|
||||||
iconUrl: getIconUrl("perfscan", "fr"),
|
iconUrl: getIconUrl("perfscan", "fr"),
|
||||||
sourceCodeUrl: heancmsSourceCodeUrl,
|
sourceCodeUrl: heancmsSourceCodeUrl,
|
||||||
version: heancmsVersion,
|
version: heancmsVersion,
|
||||||
dateFormat: defaultDateFormat,
|
dateFormat: defaultDateFormat,
|
||||||
dateFormatLocale: defaultDateFormatLocale),
|
dateFormatLocale: defaultDateFormatLocale),
|
||||||
Source(
|
// Source(
|
||||||
name: "Glorious Scan",
|
// name: "Glorious Scan",
|
||||||
baseUrl: "https://gloriousscan.com",
|
// baseUrl: "https://gloriousscan.com",
|
||||||
apiUrl: "https://api.gloriousscan.com",
|
// apiUrl: "https://api.gloriousscan.com",
|
||||||
lang: "pt-BR",
|
// lang: "pt-br",
|
||||||
typeSource: "heancms",
|
// typeSource: "heancms",
|
||||||
isNsfw: true,
|
// iconUrl: getIconUrl("gloriousscan", "pt"),
|
||||||
iconUrl: getIconUrl("gloriousscan", "pt-BR"),
|
// sourceCodeUrl: heancmsSourceCodeUrl,
|
||||||
sourceCodeUrl: heancmsSourceCodeUrl,
|
// version: heancmsVersion,
|
||||||
version: heancmsVersion,
|
// dateFormat: defaultDateFormat,
|
||||||
dateFormat: defaultDateFormat,
|
// dateFormatLocale: defaultDateFormatLocale),
|
||||||
dateFormatLocale: defaultDateFormatLocale),
|
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -246,7 +246,7 @@ List<Source> _mangareaderSourcesList = [
|
|||||||
Source(
|
Source(
|
||||||
name: "Mundo Mangá-Kun",
|
name: "Mundo Mangá-Kun",
|
||||||
baseUrl: "https://mundomangakun.com.br",
|
baseUrl: "https://mundomangakun.com.br",
|
||||||
lang: "pt-BR",
|
lang: "pt-br",
|
||||||
isNsfw: true,
|
isNsfw: true,
|
||||||
iconUrl: getIconUrl("mundomangakun", "pt"),
|
iconUrl: getIconUrl("mundomangakun", "pt"),
|
||||||
dateFormat: "MMMMM dd, yyyy",
|
dateFormat: "MMMMM dd, yyyy",
|
||||||
@@ -256,7 +256,7 @@ List<Source> _mangareaderSourcesList = [
|
|||||||
Source(
|
Source(
|
||||||
name: "Origami Orpheans",
|
name: "Origami Orpheans",
|
||||||
baseUrl: "https://origami-orpheans.com.br",
|
baseUrl: "https://origami-orpheans.com.br",
|
||||||
lang: "pt-BR",
|
lang: "pt-br",
|
||||||
iconUrl: getIconUrl("origamiorpheans", "pt"),
|
iconUrl: getIconUrl("origamiorpheans", "pt"),
|
||||||
dateFormat: "MMMMM dd, yyyy",
|
dateFormat: "MMMMM dd, yyyy",
|
||||||
dateFormatLocale: "pt-BR",
|
dateFormatLocale: "pt-BR",
|
||||||
|
|||||||
Reference in New Issue
Block a user