mirror of
https://github.com/kodjodevf/mangayomi-extensions.git
synced 2026-02-14 02:41:39 +00:00
new source : FrAnime (FR)
This commit is contained in:
412
anime/src/fr/franime-v0.0.1.dart
Normal file
412
anime/src/fr/franime-v0.0.1.dart
Normal file
@@ -0,0 +1,412 @@
|
||||
import 'dart:convert';
|
||||
import 'package:bridge_lib/bridge_lib.dart';
|
||||
|
||||
Future<String> dataBase(int sourceId) async {
|
||||
final data = {
|
||||
"url": "https://api.franime.fr/api/animes/",
|
||||
"headers": {"Referer": "https://franime.fr/"},
|
||||
"sourceId": sourceId
|
||||
};
|
||||
final res = await MBridge.http(json.encode(data), 0);
|
||||
return res;
|
||||
}
|
||||
|
||||
getPopularAnime(MangaModel anime) async {
|
||||
final data = {
|
||||
"url": "https://api.franime.fr/api/animes/",
|
||||
"headers": {"Referer": "https://franime.fr/"},
|
||||
"sourceId": anime.sourceId
|
||||
};
|
||||
final res = await MBridge.http(json.encode(data), 0);
|
||||
|
||||
List<MangaModel> animeList = animePage(res);
|
||||
if (res.isEmpty) {
|
||||
return anime;
|
||||
}
|
||||
|
||||
return animeList;
|
||||
}
|
||||
|
||||
List<MangaModel> animePage(String res) {
|
||||
final statusList = [
|
||||
{"EN COURS": 0, "TERMINÉ": 1}
|
||||
];
|
||||
List<MangaModel> animeList = [];
|
||||
final genres = MBridge.jsonPathToList(res, r'$..themes', 1);
|
||||
final images = MBridge.jsonPathToList(res, r'$..affiche', 0);
|
||||
final descriptions = MBridge.jsonPathToList(res, r'$..description', 0);
|
||||
final seasonss = MBridge.jsonPathToList(res, r'$..saisons', 1);
|
||||
final statuss = MBridge.jsonPathToList(res, r'$..status', 0);
|
||||
final titles = MBridge.jsonPathToList(res, r'$..title', 0);
|
||||
final titleOs = MBridge.jsonPathToList(res, r'$..titleO', 0);
|
||||
final langs =
|
||||
MBridge.jsonPathToList(res, r'$..saisons[*].episodes[*].lang', 1);
|
||||
int index = 0;
|
||||
for (var saisons in seasonss) {
|
||||
MangaModel anime = MangaModel();
|
||||
List<String> seasons = MBridge.jsonDecodeToList(saisons, 0);
|
||||
final titleO = MBridge.listParse(titleOs, 0)[index];
|
||||
final vo = MBridge.getMapValue(MBridge.listParse(langs, 0)[index], "vo", 1);
|
||||
final vf = MBridge.getMapValue(MBridge.listParse(langs, 0)[index], "vf", 1);
|
||||
final hasVostfr = MBridge.isEmptyOrIsNotEmpty(
|
||||
MBridge.jsonDecodeToList(MBridge.getMapValue(vo, "lecteurs", 1), 0), 1);
|
||||
final hasVf = MBridge.isEmptyOrIsNotEmpty(
|
||||
MBridge.jsonDecodeToList(MBridge.getMapValue(vf, "lecteurs", 1), 0), 1);
|
||||
if (hasVostfr) {
|
||||
for (int i = 0; i < seasons.length; i++) {
|
||||
int ind = i + 1;
|
||||
String title = MBridge.listParse(titles, 0)[index].toString();
|
||||
anime.genre =
|
||||
MBridge.jsonDecodeToList(MBridge.listParse(genres, 0)[index], 0);
|
||||
anime.description =
|
||||
MBridge.listParse(descriptions, 0)[index].toString();
|
||||
String seasonTitle = title;
|
||||
if (seasons.length > 1) {
|
||||
seasonTitle += " S$ind";
|
||||
}
|
||||
if (hasVostfr) {
|
||||
seasonTitle += " VOSTFR";
|
||||
}
|
||||
anime.status = MBridge.parseStatus(
|
||||
MBridge.listParse(statuss, 0)[index], statusList);
|
||||
anime.name = seasonTitle;
|
||||
anime.imageUrl = MBridge.listParse(images, 0)[index];
|
||||
anime.link =
|
||||
"/anime/${MBridge.regExp(titleO, "[^A-Za-z0-9 ]", "", 0, 0).replaceAll(" ", "-").toLowerCase()}?lang=vo&s=$ind";
|
||||
ind++;
|
||||
}
|
||||
} else if (hasVf) {
|
||||
for (int i = 0; i < seasons.length; i++) {
|
||||
int ind = i + 1;
|
||||
String title = MBridge.listParse(titles, 0)[index].toString();
|
||||
anime.genre =
|
||||
MBridge.jsonDecodeToList(MBridge.listParse(genres, 0)[index], 0);
|
||||
anime.description =
|
||||
MBridge.listParse(descriptions, 0)[index].toString();
|
||||
String seasonTitle = title;
|
||||
if (seasons.length > 1) {
|
||||
seasonTitle += " S$ind";
|
||||
}
|
||||
if (hasVf) {
|
||||
seasonTitle += " VF";
|
||||
}
|
||||
anime.status = MBridge.parseStatus(
|
||||
MBridge.listParse(statuss, 0)[index], statusList);
|
||||
anime.name = seasonTitle;
|
||||
anime.imageUrl = MBridge.listParse(images, 0)[index];
|
||||
anime.link =
|
||||
"/anime/${MBridge.regExp(titleO, "[^A-Za-z0-9 ]", "", 0, 0).replaceAll(" ", "-").toLowerCase()}?lang=vo&s=$ind";
|
||||
ind++;
|
||||
}
|
||||
}
|
||||
animeList.add(anime);
|
||||
index++;
|
||||
}
|
||||
return animeList;
|
||||
}
|
||||
|
||||
String databaseAnimeByTitleO(String res, String titleO) {
|
||||
List<String> datas = MBridge.jsonDecodeToList(res, 1);
|
||||
for (var data in datas) {
|
||||
if (MBridge.regExp(MBridge.getMapValue(data, "titleO", 0), "[^A-Za-z0-9 ]",
|
||||
"", 0, 0)
|
||||
.replaceAll(" ", "-")
|
||||
.toLowerCase() ==
|
||||
"${titleO}") {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
return "dffd";
|
||||
}
|
||||
|
||||
getAnimeDetail(MangaModel anime) async {
|
||||
String language = "vo".toString();
|
||||
|
||||
if (anime.link.contains("lang=")) {
|
||||
language = MBridge.listParse(
|
||||
MBridge.listParse(anime.link.split("lang="), 2)[0].split("&"), 1)[0];
|
||||
print(language);
|
||||
}
|
||||
String stem = MBridge.listParse(
|
||||
MBridge.listParse(anime.link.split("/"), 2)[0].split("?"), 1)[0];
|
||||
final res = await dataBase(anime.sourceId);
|
||||
final animeByTitleOJson = databaseAnimeByTitleO(res, stem);
|
||||
String seasonsJson =
|
||||
MBridge.jsonPathToList(animeByTitleOJson, r'$..saisons', 1)[0];
|
||||
List<String> seasons = MBridge.jsonDecodeToList(seasonsJson, 1);
|
||||
|
||||
if (anime.link.contains("s=")) {
|
||||
int seasonNumber =
|
||||
MBridge.intParse(MBridge.listParse(anime.link.split("s="), 2)[0]);
|
||||
seasonsJson = MBridge.listParse(seasons, 0)[seasonNumber - 1];
|
||||
} else {
|
||||
seasonsJson = MBridge.listParse(seasons, 0)[0];
|
||||
}
|
||||
final episodesJson =
|
||||
MBridge.jsonPathToList(seasonsJson, r'$..episodes', 1)[0];
|
||||
List<String> episodes = MBridge.jsonDecodeToList(episodesJson, 1);
|
||||
List<String> episodesNames = [];
|
||||
List<String> episodesUrls = [];
|
||||
for (int i = 0; i < episodes.length; i++) {
|
||||
print(i);
|
||||
String episode = MBridge.listParse(episodes, 0)[i];
|
||||
final lang = MBridge.getMapValue(episode, "lang", 1);
|
||||
final vo = MBridge.getMapValue(lang, "vo", 1);
|
||||
final vf = MBridge.getMapValue(lang, "vf", 1);
|
||||
final hasVostfr = MBridge.isEmptyOrIsNotEmpty(
|
||||
MBridge.jsonDecodeToList(MBridge.getMapValue(vo, "lecteurs", 1), 0), 1);
|
||||
final hasVf = MBridge.isEmptyOrIsNotEmpty(
|
||||
MBridge.jsonDecodeToList(MBridge.getMapValue(vf, "lecteurs", 1), 0), 1);
|
||||
bool playerIsNotEmpty = false;
|
||||
if (language == "vo" && hasVostfr) {
|
||||
playerIsNotEmpty = true;
|
||||
} else if (language == "vf" && hasVf) {
|
||||
playerIsNotEmpty = true;
|
||||
}
|
||||
if (playerIsNotEmpty) {
|
||||
episodesUrls.add("${anime.link}&ep=${i + 1}");
|
||||
final title = MBridge.getMapValue(episode, "title", 1);
|
||||
episodesNames.add(title.replaceAll('"', ""));
|
||||
}
|
||||
}
|
||||
if (res.isEmpty) {
|
||||
return anime;
|
||||
}
|
||||
anime.urls = episodesUrls;
|
||||
anime.names = episodesNames;
|
||||
anime.chaptersDateUploads = [];
|
||||
return anime;
|
||||
}
|
||||
|
||||
getLatestUpdatesAnime(MangaModel anime) async {
|
||||
final res = await dataBase(anime.sourceId);
|
||||
|
||||
if (res.isEmpty) {
|
||||
return anime;
|
||||
}
|
||||
List<String> reversed =
|
||||
MBridge.listParse(MBridge.jsonDecodeToList(res, 1), 5);
|
||||
String reversedJson = "".toString();
|
||||
for (int i = 0; i < reversed.length; i++) {
|
||||
final va = MBridge.listParse(reversed, 0)[i];
|
||||
String vg = "".toString();
|
||||
if (reversedJson.isNotEmpty) {
|
||||
vg = ",".toString();
|
||||
}
|
||||
reversedJson += "$vg$va";
|
||||
}
|
||||
List<MangaModel> animeList = animePage("[${reversedJson}]");
|
||||
|
||||
return animeList;
|
||||
}
|
||||
|
||||
searchAnime(MangaModel anime) async {
|
||||
final res = await dataBase(anime.sourceId);
|
||||
|
||||
if (res.isEmpty) {
|
||||
return anime;
|
||||
}
|
||||
List<MangaModel> animeList = animeSeachFetch(res, anime.query);
|
||||
return animeList;
|
||||
}
|
||||
|
||||
List<MangaModel> animeSeachFetch(String res, query) {
|
||||
final statusList = [
|
||||
{"EN COURS": 0, "TERMINÉ": 1}
|
||||
];
|
||||
List<MangaModel> animeList = [];
|
||||
final genres = MBridge.jsonPathToList(res, r'$..themes', 1);
|
||||
final images = MBridge.jsonPathToList(res, r'$..affiche', 0);
|
||||
final descriptions = MBridge.jsonPathToList(res, r'$..description', 0);
|
||||
final seasonss = MBridge.jsonPathToList(res, r'$..saisons', 1);
|
||||
final statuss = MBridge.jsonPathToList(res, r'$..status', 0);
|
||||
final titles = MBridge.jsonPathToList(res, r'$..title', 0);
|
||||
final titleOs = MBridge.jsonPathToList(res, r'$..titleO', 0);
|
||||
final titlesAlt = MBridge.jsonPathToList(res, r'$..titles', 1);
|
||||
final langs =
|
||||
MBridge.jsonPathToList(res, r'$..saisons[*].episodes[*].lang', 1);
|
||||
int index = 0;
|
||||
for (var saisons in seasonss) {
|
||||
MangaModel anime = MangaModel();
|
||||
List<String> seasons = MBridge.jsonDecodeToList(saisons, 0);
|
||||
final titleO = MBridge.listParse(titleOs, 0)[index];
|
||||
final titleAlt = MBridge.listParse(titlesAlt, 0)[index];
|
||||
final enContains = MBridge.getMapValue(titleAlt, "en", 0)
|
||||
.toString()
|
||||
.toLowerCase()
|
||||
.contains(query);
|
||||
final enJpContains = MBridge.getMapValue(titleAlt, "en_jp", 0)
|
||||
.toString()
|
||||
.toLowerCase()
|
||||
.contains(query);
|
||||
final jaJpContains = MBridge.getMapValue(titleAlt, "ja_jp", 0)
|
||||
.toString()
|
||||
.toLowerCase()
|
||||
.contains(query);
|
||||
final titleOContains = titleO.toLowerCase().contains(query);
|
||||
bool contains = false;
|
||||
if (enContains) {
|
||||
contains = true;
|
||||
}
|
||||
if (enJpContains) {
|
||||
contains = true;
|
||||
}
|
||||
if (jaJpContains) {
|
||||
contains = true;
|
||||
}
|
||||
if (titleOContains) {
|
||||
contains = true;
|
||||
}
|
||||
if (contains) {
|
||||
final vo =
|
||||
MBridge.getMapValue(MBridge.listParse(langs, 0)[index], "vo", 1);
|
||||
final vf =
|
||||
MBridge.getMapValue(MBridge.listParse(langs, 0)[index], "vf", 1);
|
||||
final hasVostfr = MBridge.isEmptyOrIsNotEmpty(
|
||||
MBridge.jsonDecodeToList(MBridge.getMapValue(vo, "lecteurs", 1), 0),
|
||||
1);
|
||||
final hasVf = MBridge.isEmptyOrIsNotEmpty(
|
||||
MBridge.jsonDecodeToList(MBridge.getMapValue(vf, "lecteurs", 1), 0),
|
||||
1);
|
||||
if (hasVostfr) {
|
||||
for (int i = 0; i < seasons.length; i++) {
|
||||
int ind = i + 1;
|
||||
String title = MBridge.listParse(titles, 0)[index].toString();
|
||||
anime.genre =
|
||||
MBridge.jsonDecodeToList(MBridge.listParse(genres, 0)[index], 0);
|
||||
anime.description =
|
||||
MBridge.listParse(descriptions, 0)[index].toString();
|
||||
String seasonTitle = title;
|
||||
if (seasons.length > 1) {
|
||||
seasonTitle += " S$ind";
|
||||
}
|
||||
if (hasVostfr) {
|
||||
seasonTitle += " VOSTFR";
|
||||
}
|
||||
anime.status = MBridge.parseStatus(
|
||||
MBridge.listParse(statuss, 0)[index], statusList);
|
||||
anime.name = seasonTitle;
|
||||
anime.imageUrl = MBridge.listParse(images, 0)[index];
|
||||
anime.link =
|
||||
"/anime/${MBridge.regExp(titleO, "[^A-Za-z0-9 ]", "", 0, 0).replaceAll(" ", "-").toLowerCase()}?lang=vo&s=$ind";
|
||||
ind++;
|
||||
}
|
||||
} else if (hasVf) {
|
||||
for (int i = 0; i < seasons.length; i++) {
|
||||
int ind = i + 1;
|
||||
String title = MBridge.listParse(titles, 0)[index].toString();
|
||||
anime.genre =
|
||||
MBridge.jsonDecodeToList(MBridge.listParse(genres, 0)[index], 0);
|
||||
anime.description =
|
||||
MBridge.listParse(descriptions, 0)[index].toString();
|
||||
String seasonTitle = title;
|
||||
if (seasons.length > 1) {
|
||||
seasonTitle += " S$ind";
|
||||
}
|
||||
if (hasVf) {
|
||||
seasonTitle += " VF";
|
||||
}
|
||||
anime.status = MBridge.parseStatus(
|
||||
MBridge.listParse(statuss, 0)[index], statusList);
|
||||
anime.name = seasonTitle;
|
||||
anime.imageUrl = MBridge.listParse(images, 0)[index];
|
||||
anime.link =
|
||||
"/anime/${MBridge.regExp(titleO, "[^A-Za-z0-9 ]", "", 0, 0).replaceAll(" ", "-").toLowerCase()}?lang=vf&s=$ind";
|
||||
ind++;
|
||||
}
|
||||
}
|
||||
animeList.add(anime);
|
||||
}
|
||||
|
||||
index++;
|
||||
}
|
||||
return animeList;
|
||||
}
|
||||
|
||||
getVideoList(MangaModel anime) async {
|
||||
String language = "vo".toString();
|
||||
String videoBaseUrl = "https://api.franime.fr/api/anime".toString();
|
||||
if (anime.link.contains("lang=")) {
|
||||
language = MBridge.listParse(
|
||||
MBridge.listParse(anime.link.split("lang="), 2)[0].split("&"), 1)[0];
|
||||
print(language);
|
||||
}
|
||||
String stem = MBridge.listParse(
|
||||
MBridge.listParse(anime.link.split("/"), 2)[0].split("?"), 1)[0];
|
||||
final res = await dataBase(anime.sourceId);
|
||||
final animeByTitleOJson = databaseAnimeByTitleO(res, stem);
|
||||
final animeId = MBridge.getMapValue(animeByTitleOJson, "id", 0);
|
||||
videoBaseUrl += "/$animeId/";
|
||||
|
||||
String seasonsJson =
|
||||
MBridge.jsonPathToList(animeByTitleOJson, r'$..saisons', 1)[0];
|
||||
List<String> seasons = MBridge.jsonDecodeToList(seasonsJson, 1);
|
||||
if (anime.link.contains("s=")) {
|
||||
int seasonNumber = MBridge.intParse(MBridge.listParse(
|
||||
MBridge.listParse(anime.link.split("s="), 2)[0].split("&"), 1)[0]);
|
||||
print(seasonNumber);
|
||||
videoBaseUrl += "${seasonNumber - 1}/";
|
||||
seasonsJson = MBridge.listParse(seasons, 0)[seasonNumber - 1];
|
||||
} else {
|
||||
seasonsJson = MBridge.listParse(seasons, 0)[0];
|
||||
videoBaseUrl += "0/";
|
||||
}
|
||||
final episodesJson =
|
||||
MBridge.jsonPathToList(seasonsJson, r'$..episodes', 1)[0];
|
||||
List<String> episodes = MBridge.jsonDecodeToList(episodesJson, 1);
|
||||
String episode = "".toString();
|
||||
if (anime.link.contains("ep=")) {
|
||||
int episodeNumber =
|
||||
MBridge.intParse(MBridge.listParse(anime.link.split("ep="), 2)[0]);
|
||||
print(episodeNumber);
|
||||
episode = MBridge.listParse(episodes, 0)[episodeNumber - 1];
|
||||
videoBaseUrl += "${episodeNumber - 1}";
|
||||
} else {
|
||||
episode = MBridge.listParse(episodes, 0)[0];
|
||||
videoBaseUrl += "0";
|
||||
}
|
||||
final lang = MBridge.getMapValue(episode, "lang", 1);
|
||||
final vo = MBridge.getMapValue(lang, "vo", 1);
|
||||
final vf = MBridge.getMapValue(lang, "vf", 1);
|
||||
final vostfrPlayers =
|
||||
MBridge.jsonDecodeToList(MBridge.getMapValue(vo, "lecteurs", 1), 0);
|
||||
final vfPlayers =
|
||||
MBridge.jsonDecodeToList(MBridge.getMapValue(vf, "lecteurs", 1), 0);
|
||||
final hasVostfr = MBridge.isEmptyOrIsNotEmpty(vostfrPlayers, 1);
|
||||
final hasVf = MBridge.isEmptyOrIsNotEmpty(vfPlayers, 1);
|
||||
List<String> players = [];
|
||||
if (language == "vo" && hasVostfr) {
|
||||
players = vostfrPlayers;
|
||||
print(players);
|
||||
} else if (language == "vf" && hasVf) {
|
||||
players = vfPlayers;
|
||||
print(players);
|
||||
}
|
||||
List<VideoModel> videos = [];
|
||||
for (int i = 0; i < players.length; i++) {
|
||||
String apiUrl = "$videoBaseUrl/$language/$i";
|
||||
String playerName = MBridge.listParse(players, 0)[i];
|
||||
final data = {
|
||||
"url": apiUrl,
|
||||
"headers": {"Referer": "https://franime.fr/"},
|
||||
"sourceId": anime.sourceId
|
||||
};
|
||||
final playerUrl = await MBridge.http(json.encode(data), 0);
|
||||
List<VideoModel> a = [];
|
||||
if (playerName.contains("franime_myvi")) {
|
||||
a = MBridge.toVideos(playerUrl, "FRAnime", playerUrl, null);
|
||||
} else if (playerName.contains("myvi")) {
|
||||
a = await MBridge.myTvExtractor(playerUrl);
|
||||
} else if (playerName.contains("sendvid")) {
|
||||
a = await MBridge.sendVidExtractor(
|
||||
playerUrl, json.encode({"Referer": "https://franime.fr/"}), "");
|
||||
} else if (playerName.contains("sibnet")) {
|
||||
a = await MBridge.sibnetExtractor(playerUrl);
|
||||
} else if (playerName.contains("sbfull")) {}
|
||||
for (var vi in a) {
|
||||
videos.add(vi);
|
||||
}
|
||||
}
|
||||
|
||||
return videos;
|
||||
}
|
||||
17
anime/src/fr/source.dart
Normal file
17
anime/src/fr/source.dart
Normal file
@@ -0,0 +1,17 @@
|
||||
import '../../../model/source.dart';
|
||||
|
||||
Source get franimeSource => _franimeSource;
|
||||
const franimeVersion = "0.0.1";
|
||||
const franimeSourceCodeUrl =
|
||||
"https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/anime/src/fr/franime/franime-v$franimeVersion.dart";
|
||||
Source _franimeSource = Source(
|
||||
name: "FrAnime",
|
||||
baseUrl: "https://franime.fr",
|
||||
apiUrl: "https://api.franime.fr",
|
||||
lang: "fr",
|
||||
typeSource: "single",
|
||||
iconUrl: '',
|
||||
sourceCodeUrl: franimeSourceCodeUrl,
|
||||
version: franimeVersion,
|
||||
isManga: false,
|
||||
isFullData: true);
|
||||
@@ -15,9 +15,9 @@ searchManga(MangaModel manga) async {
|
||||
List<String> urls = [];
|
||||
List<String> images = [];
|
||||
if (res.startsWith("{")) {
|
||||
jsonList = MBridge.jsonPathToList(res, r'$.data[*]');
|
||||
jsonList = MBridge.jsonPathToList(res, r'$.data[*]', 0);
|
||||
} else {
|
||||
jsonList = MBridge.jsonDecodeToList(res);
|
||||
jsonList = MBridge.jsonDecodeToList(res,0);
|
||||
}
|
||||
for (var a in jsonList) {
|
||||
final thumbnail = MBridge.getMapValue(a, "thumbnail", 0);
|
||||
@@ -62,9 +62,9 @@ getPopularManga(MangaModel manga) async {
|
||||
List<String> urls = [];
|
||||
List<String> images = [];
|
||||
if (res.startsWith("{")) {
|
||||
jsonList = MBridge.jsonPathToList(res, r'$.data[*]');
|
||||
jsonList = MBridge.jsonPathToList(res, r'$.data[*]', 0);
|
||||
} else {
|
||||
jsonList = MBridge.jsonDecodeToList(res);
|
||||
jsonList = MBridge.jsonDecodeToList(res,0);
|
||||
}
|
||||
for (var a in jsonList) {
|
||||
final thumbnail = MBridge.getMapValue(a, "thumbnail", 0);
|
||||
@@ -109,9 +109,9 @@ getLatestUpdatesManga(MangaModel manga) async {
|
||||
List<String> urls = [];
|
||||
List<String> images = [];
|
||||
if (res.startsWith("{")) {
|
||||
jsonList = MBridge.jsonPathToList(res, r'$.data[*]');
|
||||
jsonList = MBridge.jsonPathToList(res, r'$.data[*]', 0);
|
||||
} else {
|
||||
jsonList = MBridge.jsonDecodeToList(res);
|
||||
jsonList = MBridge.jsonDecodeToList(res,0);
|
||||
}
|
||||
for (var a in jsonList) {
|
||||
final thumbnail = MBridge.getMapValue(a, "thumbnail", 0);
|
||||
@@ -147,7 +147,7 @@ getMangaDetail(MangaModel manga) async {
|
||||
manga.genre =
|
||||
MBridge.jsonPathToString(res, r"$.tags[*].name", "._").split("._");
|
||||
|
||||
final chapters = MBridge.jsonPathToList(res, r"$.chapters[*]");
|
||||
final chapters = MBridge.jsonPathToList(res, r"$.chapters[*]", 0);
|
||||
List<String> chapterTitles = [];
|
||||
List<String> chapterUrls = [];
|
||||
List<String> chapterDates = [];
|
||||
@@ -179,7 +179,7 @@ getChapterUrl(MangaModel manga) async {
|
||||
if (res.isEmpty) {
|
||||
return [];
|
||||
}
|
||||
final pages = MBridge.jsonPathToList(res, r"$.content.images[*]");
|
||||
final pages = MBridge.jsonPathToList(res, r"$.content.images[*]", 0);
|
||||
List<String> pageUrls = [];
|
||||
for (var u in pages) {
|
||||
final url = u.replaceAll('"', "");
|
||||
|
||||
@@ -195,7 +195,7 @@ getChapterUrl(MangaModel manga) async {
|
||||
if (pages.length == 1) {
|
||||
final images =
|
||||
MBridge.regExp(res, "\"images\"\\s*:\\s*(\\[.*?])", "", 1, 1);
|
||||
final pages = MBridge.jsonDecodeToList(images);
|
||||
final pages = MBridge.jsonDecodeToList(images,0);
|
||||
for (var page in pages) {
|
||||
pagesUrl.add(page);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ searchManga(MangaModel manga) async {
|
||||
if (res.isEmpty) {
|
||||
return manga;
|
||||
}
|
||||
final jsonList = MBridge.jsonPathToList(res, r'$.suggestions[*]');
|
||||
final jsonList = MBridge.jsonPathToList(res, r'$.suggestions[*]', 0);
|
||||
List<String> urls = [];
|
||||
List<String> names = [];
|
||||
List<String> images = [];
|
||||
|
||||
@@ -9,14 +9,14 @@ getLatestUpdatesManga(MangaModel manga) async {
|
||||
if (res.isEmpty) {
|
||||
return manga;
|
||||
}
|
||||
manga.names = MBridge.jsonPathToList(res, r'$.title');
|
||||
List<String> ids = MBridge.jsonPathToList(res, r'$.hid');
|
||||
manga.names = MBridge.jsonPathToList(res, r'$.title', 0);
|
||||
List<String> ids = MBridge.jsonPathToList(res, r'$.hid', 0);
|
||||
List<String> mangaUrls = [];
|
||||
for (var id in ids) {
|
||||
mangaUrls.add("/comic/$id/#");
|
||||
}
|
||||
manga.urls = mangaUrls;
|
||||
manga.images = MBridge.jsonPathToList(res, r'$.cover_url');
|
||||
manga.images = MBridge.jsonPathToList(res, r'$.cover_url', 0);
|
||||
return manga;
|
||||
}
|
||||
|
||||
@@ -88,14 +88,14 @@ getPopularManga(MangaModel manga) async {
|
||||
if (res.isEmpty) {
|
||||
return manga;
|
||||
}
|
||||
manga.names = MBridge.jsonPathToList(res, r'$.title');
|
||||
List<String> ids = MBridge.jsonPathToList(res, r'$.hid');
|
||||
manga.names = MBridge.jsonPathToList(res, r'$.title', 0);
|
||||
List<String> ids = MBridge.jsonPathToList(res, r'$.hid', 0);
|
||||
List<String> mangaUrls = [];
|
||||
for (var id in ids) {
|
||||
mangaUrls.add("/comic/$id/#");
|
||||
}
|
||||
manga.urls = mangaUrls;
|
||||
manga.images = MBridge.jsonPathToList(res, r'$.cover_url');
|
||||
manga.images = MBridge.jsonPathToList(res, r'$.cover_url', 0);
|
||||
return manga;
|
||||
}
|
||||
|
||||
@@ -106,14 +106,14 @@ searchManga(MangaModel manga) async {
|
||||
if (res.isEmpty) {
|
||||
return manga;
|
||||
}
|
||||
manga.names = MBridge.jsonPathToList(res, r'$.title');
|
||||
List<String> ids = MBridge.jsonPathToList(res, r'$.hid');
|
||||
manga.names = MBridge.jsonPathToList(res, r'$.title', 0);
|
||||
List<String> ids = MBridge.jsonPathToList(res, r'$.hid', 0);
|
||||
List<String> mangaUrls = [];
|
||||
for (var id in ids) {
|
||||
mangaUrls.add("/comic/$id/#");
|
||||
}
|
||||
manga.urls = mangaUrls;
|
||||
manga.images = MBridge.jsonPathToList(res, r'$.cover_url');
|
||||
manga.images = MBridge.jsonPathToList(res, r'$.cover_url', 0);
|
||||
return manga;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,11 +43,11 @@ MangaModel getChapters(
|
||||
String chapDate = MBridge.stringParse("");
|
||||
String chapterUrl = MBridge.stringParse("");
|
||||
String paginatedChapterList = MBridge.stringParse(paginatedChapterListA);
|
||||
final dataList = MBridge.jsonPathToList(paginatedChapterList, r'$.data[*]');
|
||||
final dataList = MBridge.jsonPathToList(paginatedChapterList, r'$.data[*]',0);
|
||||
for (var res in dataList) {
|
||||
String scan = MBridge.stringParse("");
|
||||
final groups = MBridge.jsonPathToList(
|
||||
res, r'$.relationships[?@.id!="00e03853-1b96-4f41-9542-c71b8692033b"]');
|
||||
res, r'$.relationships[?@.id!="00e03853-1b96-4f41-9542-c71b8692033b"]',0);
|
||||
String chapName = MBridge.stringParse("");
|
||||
for (var element in groups) {
|
||||
final data = MBridge.getMapValue(element, "attributes", 1);
|
||||
|
||||
@@ -26,6 +26,8 @@ class Source {
|
||||
|
||||
bool? isManga;
|
||||
|
||||
bool? isFullData;
|
||||
|
||||
Source({
|
||||
this.id = null,
|
||||
this.name = "",
|
||||
@@ -41,6 +43,7 @@ class Source {
|
||||
this.apiUrl = "",
|
||||
this.version = "",
|
||||
this.isManga = true,
|
||||
this.isFullData = false,
|
||||
});
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
|
||||
Reference in New Issue
Block a user