Reorganize folders
323
dart/manga/multisrc/mmrcms/mmrcms.dart
Normal file
@@ -0,0 +1,323 @@
|
||||
import 'package:mangayomi/bridge_lib.dart';
|
||||
import 'dart:convert';
|
||||
|
||||
class MMRCMS extends MProvider {
|
||||
MMRCMS({required this.source});
|
||||
|
||||
MSource source;
|
||||
|
||||
final Client client = Client(source);
|
||||
|
||||
@override
|
||||
Future<MPages> getPopular(int page) async {
|
||||
final res = (await client.get(Uri.parse(
|
||||
"${source.baseUrl}/filterList?page=$page&sortBy=views&asc=false")))
|
||||
.body;
|
||||
|
||||
List<MManga> mangaList = [];
|
||||
final urls = xpath(res, '//*[ @class="chart-title"]/@href');
|
||||
final names = xpath(res, '//*[ @class="chart-title"]/text()');
|
||||
List<String> images = [];
|
||||
for (var url in urls) {
|
||||
String slug = substringAfterLast(url, '/');
|
||||
if (source.name == "Manga-FR") {
|
||||
images.add("${source.baseUrl}/uploads/manga/${slug}.jpg");
|
||||
} else {
|
||||
images.add(
|
||||
"${source.baseUrl}/uploads/manga/${slug}/cover/cover_250x350.jpg");
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = 0; i < names.length; i++) {
|
||||
MManga manga = MManga();
|
||||
manga.name = names[i];
|
||||
manga.imageUrl = images[i];
|
||||
manga.link = urls[i];
|
||||
mangaList.add(manga);
|
||||
}
|
||||
|
||||
return MPages(mangaList, true);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MPages> getLatestUpdates(int page) async {
|
||||
final res = (await client
|
||||
.get(Uri.parse("${source.baseUrl}/latest-release?page=$page")))
|
||||
.body;
|
||||
|
||||
List<MManga> mangaList = [];
|
||||
final urls = xpath(res, '//*[@class="manga-item"]/h3/a/@href');
|
||||
final names = xpath(res, '//*[@class="manga-item"]/h3/a/text()');
|
||||
List<String> images = [];
|
||||
for (var url in urls) {
|
||||
String slug = substringAfterLast(url, '/');
|
||||
if (source.name == "Manga-FR") {
|
||||
images.add("${source.baseUrl}/uploads/manga/${slug}.jpg");
|
||||
} else {
|
||||
images.add(
|
||||
"${source.baseUrl}/uploads/manga/${slug}/cover/cover_250x350.jpg");
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = 0; i < names.length; i++) {
|
||||
MManga manga = MManga();
|
||||
manga.name = names[i];
|
||||
manga.imageUrl = images[i];
|
||||
manga.link = urls[i];
|
||||
mangaList.add(manga);
|
||||
}
|
||||
|
||||
return MPages(mangaList, true);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MPages> search(String query, int page, FilterList filterList) async {
|
||||
final filters = filterList.filters;
|
||||
String url = "";
|
||||
if (query.isNotEmpty) {
|
||||
url = "${source.baseUrl}/search?query=$query";
|
||||
} else {
|
||||
url = "${source.baseUrl}/filterList?page=$page";
|
||||
for (var filter in filters) {
|
||||
if (filter.type == "AuthorFilter") {
|
||||
url += "${ll(url)}author=${Uri.encodeComponent(filter.state)}";
|
||||
} else if (filter.type == "SortFilter") {
|
||||
url += "${ll(url)}sortBy=${filter.values[filter.state.index].value}";
|
||||
final asc = filter.state.ascending ? "asc=true" : "asc=false";
|
||||
url += "${ll(url)}$asc";
|
||||
} else if (filter.type == "CategoryFilter") {
|
||||
if (filter.state != 0) {
|
||||
final cat = filter.values[filter.state].value;
|
||||
url += "${ll(url)}cat=$cat";
|
||||
}
|
||||
} else if (filter.type == "BeginsWithFilter") {
|
||||
if (filter.state != 0) {
|
||||
final a = filter.values[filter.state].value;
|
||||
url += "${ll(url)}alpha=$a";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final res = (await client.get(Uri.parse(url))).body;
|
||||
|
||||
List<MManga> mangaList = [];
|
||||
|
||||
List<String> urls = [];
|
||||
List<String> names = [];
|
||||
List<String> images = [];
|
||||
|
||||
if (query.isNotEmpty) {
|
||||
final jsonList = json.decode(res)["suggestions"];
|
||||
for (var da in jsonList) {
|
||||
String value = da["value"];
|
||||
String data = da["data"];
|
||||
if (source.name == 'Scan VF') {
|
||||
urls.add('${source.baseUrl}/$data');
|
||||
} else if (source.name == 'Manga-FR') {
|
||||
urls.add('${source.baseUrl}/lecture-en-ligne/$data');
|
||||
} else {
|
||||
urls.add('${source.baseUrl}/manga/$data');
|
||||
}
|
||||
names.add(value);
|
||||
if (source.name == "Manga-FR") {
|
||||
images.add("${source.baseUrl}/uploads/manga/$data.jpg");
|
||||
} else {
|
||||
images.add(
|
||||
"${source.baseUrl}/uploads/manga/$data/cover/cover_250x350.jpg");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
urls = xpath(res, '//div/div/div/a/@href');
|
||||
names = xpath(res, '//div/div/div/a/text()');
|
||||
for (var url in urls) {
|
||||
String slug = substringAfterLast(url, '/');
|
||||
if (source.name == "Manga-FR") {
|
||||
images.add("${source.baseUrl}/uploads/manga/${slug}.jpg");
|
||||
} else {
|
||||
images.add(
|
||||
"${source.baseUrl}/uploads/manga/${slug}/cover/cover_250x350.jpg");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = 0; i < names.length; i++) {
|
||||
MManga manga = MManga();
|
||||
manga.name = names[i];
|
||||
manga.imageUrl = images[i];
|
||||
manga.link = urls[i];
|
||||
mangaList.add(manga);
|
||||
}
|
||||
|
||||
return MPages(mangaList, true);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<MManga> getDetail(String url) 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
|
||||
}
|
||||
];
|
||||
MManga manga = MManga();
|
||||
final res = (await client.get(Uri.parse(url))).body;
|
||||
|
||||
final author = xpath(res,
|
||||
'//*[@class="dl-horizontal"]/dt[contains(text(), "Auteur(s)") or contains(text(), "Author(s)") or contains(text(), "Autor(es)") or contains(text(), "Yazar(lar) or contains(text(), "Mangaka(lar)")]//following-sibling::dd[1]/text()');
|
||||
if (author.isNotEmpty) {
|
||||
manga.author = author.first;
|
||||
}
|
||||
final status = xpath(res,
|
||||
'//*[@class="dl-horizontal"]/dt[contains(text(), "Statut") or contains(text(), "Status") or contains(text(), "Estado") or contains(text(), "Durum")]/following-sibling::dd[1]/text()');
|
||||
if (status.isNotEmpty) {
|
||||
manga.status = parseStatus(status.first, statusList);
|
||||
}
|
||||
|
||||
final description =
|
||||
xpath(res, '//*[@class="well" or @class="manga well"]/p/text()');
|
||||
if (description.isNotEmpty) {
|
||||
manga.description = description.first;
|
||||
}
|
||||
|
||||
manga.genre = xpath(res,
|
||||
'//*[@class="dl-horizontal"]/dt[contains(text(), "Categories") or contains(text(), "Categorias") or contains(text(), "Categorías") or contains(text(), "Catégories") or contains(text(), "Kategoriler" or contains(text(), "Kategorie") or contains(text(), "Kategori") or contains(text(), "Tagi"))]/following-sibling::dd[1]/text()');
|
||||
|
||||
var chapUrls = xpath(res, '//*[@class="chapter-title-rtl"]/a/@href');
|
||||
var chaptersNames = xpath(res, '//*[@class="chapter-title-rtl"]/a/text()');
|
||||
var chaptersDates =
|
||||
xpath(res, '//*[@class="date-chapter-title-rtl"]/text()');
|
||||
|
||||
var dateUploads =
|
||||
parseDates(chaptersDates, source.dateFormat, source.dateFormatLocale);
|
||||
|
||||
List<MChapter>? chaptersList = [];
|
||||
for (var i = 0; i < chaptersNames.length; i++) {
|
||||
MChapter chapter = MChapter();
|
||||
chapter.name = chaptersNames[i];
|
||||
chapter.url = chapUrls[i];
|
||||
chapter.dateUpload = dateUploads[i];
|
||||
chaptersList.add(chapter);
|
||||
}
|
||||
manga.chapters = chaptersList;
|
||||
return manga;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<String>> getPageList(String url) async {
|
||||
final res = (await client.get(Uri.parse(url))).body;
|
||||
|
||||
List<String> pagesUrl = [];
|
||||
final pages =
|
||||
xpath(res, '//*[@id="all"]/img[@class="img-responsive"]/@data-src');
|
||||
for (var page in pages) {
|
||||
if (page.startsWith('//')) {
|
||||
pagesUrl.add(page.replaceAll('//', 'https://'));
|
||||
} else {
|
||||
pagesUrl.add(page);
|
||||
}
|
||||
}
|
||||
|
||||
return pagesUrl;
|
||||
}
|
||||
|
||||
List<dynamic> getFilterList() {
|
||||
return [
|
||||
HeaderFilter("NOTE: Ignored if using text search!"),
|
||||
SeparatorFilter(),
|
||||
TextFilter("AuthorFilter", "Author"),
|
||||
SelectFilter("CategoryFilter", "Category", 0, [
|
||||
SelectFilterOption("Any", ""),
|
||||
SelectFilterOption("Action", "Action"),
|
||||
SelectFilterOption("Adventure", "Adventure"),
|
||||
SelectFilterOption("Comedy", "Comedy"),
|
||||
SelectFilterOption("Doujinshi", "Doujinshi"),
|
||||
SelectFilterOption("Drama", "Drama"),
|
||||
SelectFilterOption("Ecchi", "Ecchi"),
|
||||
SelectFilterOption("Fantasy", "Fantasy"),
|
||||
SelectFilterOption("Gender Bender", "Gender Bender"),
|
||||
SelectFilterOption("Harem", "Harem"),
|
||||
SelectFilterOption("Historical", "Historical"),
|
||||
SelectFilterOption("Horror", "Horror"),
|
||||
SelectFilterOption("Josei", "Josei"),
|
||||
SelectFilterOption("Martial Arts", "Martial Arts"),
|
||||
SelectFilterOption("Mature", "Mature"),
|
||||
SelectFilterOption("Mecha", "Mecha"),
|
||||
SelectFilterOption("Mystery", "Mystery"),
|
||||
SelectFilterOption("One Shot", "One Shot"),
|
||||
SelectFilterOption("Psychological", "Psychological"),
|
||||
SelectFilterOption("Romance", "Romance"),
|
||||
SelectFilterOption("School Life", "School Life"),
|
||||
SelectFilterOption("Sci-fi", "Sci-fi"),
|
||||
SelectFilterOption("Seinen", "Seinen"),
|
||||
SelectFilterOption("Shoujo", "Shoujo"),
|
||||
SelectFilterOption("Shoujo Ai", "Shoujo Ai"),
|
||||
SelectFilterOption("Shounen", "Shounen"),
|
||||
SelectFilterOption("Shounen Ai", "Shounen Ai"),
|
||||
SelectFilterOption("Slice of Life", "Slice of Life"),
|
||||
SelectFilterOption("Sports", "Sports"),
|
||||
SelectFilterOption("Supernatural", "Supernatural"),
|
||||
SelectFilterOption("Tragedy", "Tragedy"),
|
||||
SelectFilterOption("Yaoi", "Yaoi"),
|
||||
SelectFilterOption("Yuri", "Yuri"),
|
||||
]),
|
||||
SelectFilter("BeginsWithFilter", "Begins with", 0, [
|
||||
SelectFilterOption("Any", ""),
|
||||
SelectFilterOption("#", "#"),
|
||||
SelectFilterOption("A", "A"),
|
||||
SelectFilterOption("B", "B"),
|
||||
SelectFilterOption("C", "C"),
|
||||
SelectFilterOption("D", "D"),
|
||||
SelectFilterOption("E", "E"),
|
||||
SelectFilterOption("F", "F"),
|
||||
SelectFilterOption("G", "G"),
|
||||
SelectFilterOption("H", "H"),
|
||||
SelectFilterOption("I", "I"),
|
||||
SelectFilterOption("J", "J"),
|
||||
SelectFilterOption("K", "K"),
|
||||
SelectFilterOption("L", "L"),
|
||||
SelectFilterOption("M", "M"),
|
||||
SelectFilterOption("N", "N"),
|
||||
SelectFilterOption("O", "O"),
|
||||
SelectFilterOption("P", "P"),
|
||||
SelectFilterOption("Q", "Q"),
|
||||
SelectFilterOption("R", "R"),
|
||||
SelectFilterOption("S", "S"),
|
||||
SelectFilterOption("T", "T"),
|
||||
SelectFilterOption("U", "U"),
|
||||
SelectFilterOption("V", "V"),
|
||||
SelectFilterOption("W", "W"),
|
||||
SelectFilterOption("X", "X"),
|
||||
SelectFilterOption("Y", "Y"),
|
||||
SelectFilterOption("Z", "Z"),
|
||||
]),
|
||||
SortFilter("SortFilter", "Sort", SortState(0, true), [
|
||||
SelectFilterOption("Name", "name"),
|
||||
SelectFilterOption("Popularity", "views"),
|
||||
SelectFilterOption("Last update", "last_release"),
|
||||
])
|
||||
];
|
||||
}
|
||||
|
||||
String ll(String url) {
|
||||
if (url.contains("?")) {
|
||||
return "&";
|
||||
}
|
||||
return "?";
|
||||
}
|
||||
}
|
||||
|
||||
MMRCMS main(MSource source) {
|
||||
return MMRCMS(source: source);
|
||||
}
|
||||
37
dart/manga/multisrc/mmrcms/sources.dart
Normal file
@@ -0,0 +1,37 @@
|
||||
import '../../../../model/source.dart';
|
||||
import 'src/scanvf/scanvf.dart';
|
||||
import 'src/komikid/komikid.dart';
|
||||
import 'src/mangaid/mangaid.dart';
|
||||
import 'src/jpmangas/jpmangas.dart';
|
||||
import 'src/onma/onma.dart';
|
||||
import 'src/readcomicsonline/readcomicsonline.dart';
|
||||
import 'src/lelscanvf/lelscanvf.dart';
|
||||
import 'src/mangafr/mangafr.dart';
|
||||
|
||||
const mmrcmsVersion = "0.0.65";
|
||||
const mmrcmsSourceCodeUrl =
|
||||
"https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/manga/multisrc/mmrcms/mmrcms.dart";
|
||||
|
||||
List<Source> get mmrcmsSourcesList => _mmrcmsSourcesList;
|
||||
List<Source> _mmrcmsSourcesList = [
|
||||
//Scan VF (FR)
|
||||
scanvfSource,
|
||||
//Komikid (ID)
|
||||
komikidSource,
|
||||
//MangaID (ID)
|
||||
mangaidSource,
|
||||
//Jpmangas (FR)
|
||||
jpmangasSource,
|
||||
//مانجا اون لاين (AR)
|
||||
onmaSource,
|
||||
//Read Comics Online (EN)
|
||||
readcomicsonlineSource,
|
||||
//Lelscan-VF (FR)
|
||||
lelscanvfSource,
|
||||
//Manga-FR (FR)
|
||||
mangafrSource,
|
||||
]
|
||||
.map((e) => e
|
||||
..sourceCodeUrl = mmrcmsSourceCodeUrl
|
||||
..version = mmrcmsVersion)
|
||||
.toList();
|
||||
BIN
dart/manga/multisrc/mmrcms/src/jpmangas/icon.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
14
dart/manga/multisrc/mmrcms/src/jpmangas/jpmangas.dart
Normal file
@@ -0,0 +1,14 @@
|
||||
import '../../../../../../model/source.dart';
|
||||
|
||||
Source get jpmangasSource => _jpmangasSource;
|
||||
|
||||
Source _jpmangasSource = Source(
|
||||
name: "Jpmangas",
|
||||
baseUrl: "https://jpmangas.cc",
|
||||
lang: "fr",
|
||||
|
||||
typeSource: "mmrcms",
|
||||
iconUrl:"https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/manga/multisrc/mmrcms/src/jpmangas/icon.png",
|
||||
dateFormat:"d MMM. yyyy",
|
||||
dateFormatLocale:"en_us",
|
||||
);
|
||||
BIN
dart/manga/multisrc/mmrcms/src/komikid/icon.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
14
dart/manga/multisrc/mmrcms/src/komikid/komikid.dart
Normal file
@@ -0,0 +1,14 @@
|
||||
import '../../../../../../model/source.dart';
|
||||
|
||||
Source get komikidSource => _komikidSource;
|
||||
|
||||
Source _komikidSource = Source(
|
||||
name: "Komikid",
|
||||
baseUrl: "https://www.komikid.com",
|
||||
lang: "id",
|
||||
|
||||
typeSource: "mmrcms",
|
||||
iconUrl:"https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/manga/multisrc/mmrcms/src/komikid/icon.png",
|
||||
dateFormat:"d MMM. yyyy",
|
||||
dateFormatLocale:"en_us",
|
||||
);
|
||||
BIN
dart/manga/multisrc/mmrcms/src/lelscanvf/icon.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
14
dart/manga/multisrc/mmrcms/src/lelscanvf/lelscanvf.dart
Normal file
@@ -0,0 +1,14 @@
|
||||
import '../../../../../../model/source.dart';
|
||||
|
||||
Source get lelscanvfSource => _lelscanvfSource;
|
||||
|
||||
Source _lelscanvfSource = Source(
|
||||
name: "Lelscan-VF",
|
||||
baseUrl: "https://www.lelscanvf.cc/",
|
||||
lang: "fr",
|
||||
|
||||
typeSource: "mmrcms",
|
||||
iconUrl:"https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/manga/multisrc/mmrcms/src/lelscanvf/icon.png",
|
||||
dateFormat:"d MMM. yyyy",
|
||||
dateFormatLocale:"en_us",
|
||||
);
|
||||
BIN
dart/manga/multisrc/mmrcms/src/mangafr/icon.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
14
dart/manga/multisrc/mmrcms/src/mangafr/mangafr.dart
Normal file
@@ -0,0 +1,14 @@
|
||||
import '../../../../../../model/source.dart';
|
||||
|
||||
Source get mangafrSource => _mangafrSource;
|
||||
|
||||
Source _mangafrSource = Source(
|
||||
name: "Manga-FR",
|
||||
baseUrl: "https://manga-fr.me",
|
||||
lang: "fr",
|
||||
|
||||
typeSource: "mmrcms",
|
||||
iconUrl:"https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/manga/multisrc/mmrcms/src/mangafr/icon.png",
|
||||
dateFormat:"d MMM. yyyy",
|
||||
dateFormatLocale:"en_us",
|
||||
);
|
||||
BIN
dart/manga/multisrc/mmrcms/src/mangaid/icon.png
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
14
dart/manga/multisrc/mmrcms/src/mangaid/mangaid.dart
Normal file
@@ -0,0 +1,14 @@
|
||||
import '../../../../../../model/source.dart';
|
||||
|
||||
Source get mangaidSource => _mangaidSource;
|
||||
|
||||
Source _mangaidSource = Source(
|
||||
name: "MangaID",
|
||||
baseUrl: "https://mangaid.click",
|
||||
lang: "id",
|
||||
|
||||
typeSource: "mmrcms",
|
||||
iconUrl:"https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/manga/multisrc/mmrcms/src/mangaid/icon.png",
|
||||
dateFormat:"d MMM. yyyy",
|
||||
dateFormatLocale:"en_us",
|
||||
);
|
||||
BIN
dart/manga/multisrc/mmrcms/src/onma/icon.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
14
dart/manga/multisrc/mmrcms/src/onma/onma.dart
Normal file
@@ -0,0 +1,14 @@
|
||||
import '../../../../../../model/source.dart';
|
||||
|
||||
Source get onmaSource => _onmaSource;
|
||||
|
||||
Source _onmaSource = Source(
|
||||
name: "مانجا اون لاين",
|
||||
baseUrl: "https://onma.top",
|
||||
lang: "ar",
|
||||
|
||||
typeSource: "mmrcms",
|
||||
iconUrl:"https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/manga/multisrc/mmrcms/src/onma/icon.png",
|
||||
dateFormat:"d MMM. yyyy",
|
||||
dateFormatLocale:"en_us",
|
||||
);
|
||||
BIN
dart/manga/multisrc/mmrcms/src/readcomicsonline/icon.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
@@ -0,0 +1,14 @@
|
||||
import '../../../../../../model/source.dart';
|
||||
|
||||
Source get readcomicsonlineSource => _readcomicsonlineSource;
|
||||
|
||||
Source _readcomicsonlineSource = Source(
|
||||
name: "Read Comics Online",
|
||||
baseUrl: "https://readcomicsonline.ru",
|
||||
lang: "en",
|
||||
|
||||
typeSource: "mmrcms",
|
||||
iconUrl:"https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/manga/multisrc/mmrcms/src/readcomicsonline/icon.png",
|
||||
dateFormat:"d MMM. yyyy",
|
||||
dateFormatLocale:"en_us",
|
||||
);
|
||||
BIN
dart/manga/multisrc/mmrcms/src/scanvf/icon.png
Normal file
|
After Width: | Height: | Size: 9.4 KiB |
14
dart/manga/multisrc/mmrcms/src/scanvf/scanvf.dart
Normal file
@@ -0,0 +1,14 @@
|
||||
import '../../../../../../model/source.dart';
|
||||
|
||||
Source get scanvfSource => _scanvfSource;
|
||||
|
||||
Source _scanvfSource = Source(
|
||||
name: "Scan VF",
|
||||
baseUrl: "https://www.scan-vf.net",
|
||||
lang: "fr",
|
||||
|
||||
typeSource: "mmrcms",
|
||||
iconUrl:"https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/manga/multisrc/mmrcms/src/scanvf/icon.png",
|
||||
dateFormat:"d MMM. yyyy",
|
||||
dateFormatLocale:"en_us",
|
||||
);
|
||||