mirror of
https://github.com/kodjodevf/mangayomi-extensions.git
synced 2026-02-14 10:51:17 +00:00
-
This commit is contained in:
@@ -1,203 +1,203 @@
|
||||
// import 'dart:convert';
|
||||
// import 'package:bridge_lib/bridge_lib.dart';
|
||||
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;
|
||||
// }
|
||||
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;
|
||||
// }
|
||||
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;
|
||||
// }
|
||||
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];
|
||||
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);
|
||||
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("._");
|
||||
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;
|
||||
// }
|
||||
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];
|
||||
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;
|
||||
// }
|
||||
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;
|
||||
// }
|
||||
Map<String, String> getHeader(String url) {
|
||||
final headers = {
|
||||
'Origin': url,
|
||||
'Referer': '$url/',
|
||||
'Accept': 'application/json, text/plain, */*',
|
||||
'Content-Type': 'application/json'
|
||||
};
|
||||
return headers;
|
||||
}
|
||||
|
||||
@@ -1,282 +1,282 @@
|
||||
// import 'dart:convert';
|
||||
import 'dart:convert';
|
||||
|
||||
// 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("-.");
|
||||
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;
|
||||
// }
|
||||
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,
|
||||
// }
|
||||
// ];
|
||||
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);
|
||||
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("-.");
|
||||
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};
|
||||
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("-.");
|
||||
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("-.");
|
||||
// }
|
||||
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}";
|
||||
// }
|
||||
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);
|
||||
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;
|
||||
// }
|
||||
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 = [];
|
||||
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, "");
|
||||
if (imgs.length == 1) {
|
||||
final pages = MBridge.querySelector(res, "#single-pager", 2, "");
|
||||
|
||||
// final pagesNumber =
|
||||
// MBridge.querySelectorAll(pages, "option", 2, "", 0, 0, '-.')
|
||||
// .split('-.');
|
||||
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;
|
||||
// }
|
||||
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;
|
||||
// }
|
||||
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;
|
||||
// }
|
||||
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;
|
||||
// }
|
||||
Map<String, String> getHeader(String url) {
|
||||
final headers = {
|
||||
"Referer": "$url/",
|
||||
};
|
||||
return headers;
|
||||
}
|
||||
|
||||
@@ -1,194 +1,194 @@
|
||||
// import 'dart:convert';
|
||||
// import 'package:bridge_lib/bridge_lib.dart';
|
||||
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;
|
||||
// }
|
||||
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;
|
||||
// }
|
||||
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,
|
||||
// }
|
||||
// ];
|
||||
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="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")]/text()',
|
||||
// '')
|
||||
// .replaceAll("Status", "")
|
||||
// .replaceAll("Estado", "")
|
||||
// .replaceAll("Statut", "");
|
||||
// manga.status = MBridge.parseStatus(status, statusList);
|
||||
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="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")]/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("-.");
|
||||
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;
|
||||
// }
|
||||
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;
|
||||
// }
|
||||
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 [];
|
||||
// }
|
||||
// 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 {
|
||||
// pagesUrl = pages;
|
||||
// }
|
||||
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.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 {
|
||||
pagesUrl = pages;
|
||||
}
|
||||
|
||||
// return pagesUrl;
|
||||
// }
|
||||
return pagesUrl;
|
||||
}
|
||||
|
||||
@@ -1,173 +1,173 @@
|
||||
// import 'dart:convert';
|
||||
// import 'package:bridge_lib/bridge_lib.dart';
|
||||
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);
|
||||
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;
|
||||
// }
|
||||
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;
|
||||
// }
|
||||
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
|
||||
// }
|
||||
// ];
|
||||
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");
|
||||
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;
|
||||
// }
|
||||
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;
|
||||
// }
|
||||
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);
|
||||
// }
|
||||
// }
|
||||
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;
|
||||
// }
|
||||
return pagesUrl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user