From 7fe3d71ab29fe84d2b8d9bfa2b4cd36a1bb552a9 Mon Sep 17 00:00:00 2001 From: kodjomoustapha <107993382+kodjodevf@users.noreply.github.com> Date: Thu, 1 Jun 2023 23:14:04 +0100 Subject: [PATCH] add more madara sources --- lib/main.dart | 2 + lib/providers/storage_provider.dart | 3 +- .../multisrc/madara/madara_source_list.dart | 292 +++++++++++++++--- lib/sources/multisrc/madara/src/madara.dart | 2 +- 4 files changed, 254 insertions(+), 45 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 8347102..1c79f3e 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -14,6 +14,7 @@ import 'package:mangayomi/models/history.dart'; import 'package:mangayomi/models/settings.dart'; import 'package:mangayomi/models/source.dart'; import 'package:mangayomi/models/manga.dart'; +import 'package:mangayomi/providers/storage_provider.dart'; import 'package:mangayomi/router/router.dart'; import 'package:mangayomi/modules/more/settings/appearance/providers/blend_level_state_provider.dart'; import 'package:mangayomi/modules/more/settings/appearance/providers/flex_scheme_color_state_provider.dart'; @@ -29,6 +30,7 @@ void main(List args) async { } WidgetsFlutterBinding.ensureInitialized(); await _initDB(); + await StorageProvider().requestPermission(); runApp(const ProviderScope(child: MyApp())); } diff --git a/lib/providers/storage_provider.dart b/lib/providers/storage_provider.dart index 11fa8e4..c3ee48a 100644 --- a/lib/providers/storage_provider.dart +++ b/lib/providers/storage_provider.dart @@ -15,9 +15,8 @@ class StorageProvider { final result = await permission.request(); if (result == PermissionStatus.granted) { return true; - } else { - return false; } + return false; } } return true; diff --git a/lib/sources/multisrc/madara/madara_source_list.dart b/lib/sources/multisrc/madara/madara_source_list.dart index fe5f315..6ca7d21 100644 --- a/lib/sources/multisrc/madara/madara_source_list.dart +++ b/lib/sources/multisrc/madara/madara_source_list.dart @@ -1,5 +1,8 @@ import 'package:mangayomi/models/source.dart'; +const defaultDateFormat = "MMMM dd, yyyy"; +const defaultDateFormatLocale = "en_US"; + List get madaraSourcesList => _madaraSourcesList; List _madaraSourcesList = [ Source( @@ -34,8 +37,8 @@ List _madaraSourcesList = [ typeSource: TypeSource.madara, logoUrl: '', isNsfw: true, - dateFormat: "MMMM dd, yyyy", - dateFormatLocale: "en_US", + dateFormat: defaultDateFormat, + dateFormatLocale: defaultDateFormatLocale, ), Source( sourceName: "Adult Webtoon", @@ -44,10 +47,9 @@ List _madaraSourcesList = [ typeSource: TypeSource.madara, logoUrl: '', isNsfw: true, - dateFormat: "MMMM dd, yyyy", - dateFormatLocale: "en_US", + dateFormat: defaultDateFormat, + dateFormatLocale: defaultDateFormatLocale, ), - Source( sourceName: "ArazNovel", baseUrl: "https://www.araznovel.com", @@ -73,7 +75,7 @@ List _madaraSourcesList = [ typeSource: TypeSource.madara, logoUrl: '', dateFormat: "MMM dd, yyyy", - dateFormatLocale: "en_US", + dateFormatLocale: defaultDateFormatLocale, ), Source( sourceName: "Clover Manga", @@ -81,10 +83,9 @@ List _madaraSourcesList = [ lang: "tr", typeSource: TypeSource.madara, logoUrl: '', - dateFormat: "MMMM dd, yyyy", + dateFormat: defaultDateFormat, dateFormatLocale: "tr", ), - Source( sourceName: "CookieToon", baseUrl: "https://cookietoon.online", @@ -139,7 +140,7 @@ List _madaraSourcesList = [ typeSource: TypeSource.madara, logoUrl: '', dateFormat: "MMMM d, yyyy", - dateFormatLocale: "en_US", + dateFormatLocale: defaultDateFormatLocale, ), Source( sourceName: "HentaiWebtoon", @@ -149,7 +150,7 @@ List _madaraSourcesList = [ typeSource: TypeSource.madara, logoUrl: '', dateFormat: "MMMM d, yyyy", - dateFormatLocale: "en_US", + dateFormatLocale: defaultDateFormatLocale, ), Source( sourceName: "Ikifeng", @@ -177,7 +178,7 @@ List _madaraSourcesList = [ typeSource: TypeSource.madara, logoUrl: '', dateFormat: "MMMM d, yyyy", - dateFormatLocale: "en_US", + dateFormatLocale: defaultDateFormatLocale, ), Source( sourceName: "Kami Sama Explorer", @@ -194,7 +195,7 @@ List _madaraSourcesList = [ lang: "id", typeSource: TypeSource.madara, logoUrl: '', - dateFormat: "MMMM dd, yyyy", + dateFormat: defaultDateFormat, dateFormatLocale: "id", ), Source( @@ -203,8 +204,8 @@ List _madaraSourcesList = [ lang: "en", typeSource: TypeSource.madara, logoUrl: '', - dateFormat: "MMMM dd, yyyy", - dateFormatLocale: "en_US", + dateFormat: defaultDateFormat, + dateFormatLocale: defaultDateFormatLocale, ), Source( sourceName: "LHTranslation", @@ -212,17 +213,18 @@ List _madaraSourcesList = [ lang: "en", typeSource: TypeSource.madara, logoUrl: '', - dateFormat: "MMMM dd, yyyy", - dateFormatLocale: "en_US", + dateFormat: defaultDateFormat, + dateFormatLocale: defaultDateFormatLocale, ), Source( sourceName: "Lolicon", baseUrl: "https://lolicon.mobi", lang: "en", + isNsfw: true, typeSource: TypeSource.madara, logoUrl: '', - dateFormat: "MMMM dd, yyyy", - dateFormatLocale: "en_US", + dateFormat: defaultDateFormat, + dateFormatLocale: defaultDateFormatLocale, ), Source( sourceName: "Lord Manga", @@ -231,7 +233,7 @@ List _madaraSourcesList = [ typeSource: TypeSource.madara, logoUrl: '', dateFormat: "MMMM d, yyyy", - dateFormatLocale: "en_US", + dateFormatLocale: defaultDateFormatLocale, ), Source( sourceName: "MangaVisa", @@ -239,8 +241,8 @@ List _madaraSourcesList = [ lang: "en", typeSource: TypeSource.madara, logoUrl: '', - dateFormat: "MMMM dd, yyyy", - dateFormatLocale: "en_US", + dateFormat: defaultDateFormat, + dateFormatLocale: defaultDateFormatLocale, ), Source( sourceName: "MangaClash", @@ -249,7 +251,7 @@ List _madaraSourcesList = [ typeSource: TypeSource.madara, logoUrl: '', dateFormat: "MM/dd/yy", - dateFormatLocale: "en_US", + dateFormatLocale: defaultDateFormatLocale, ), Source( sourceName: "Manga District", @@ -259,7 +261,7 @@ List _madaraSourcesList = [ logoUrl: '', isNsfw: true, dateFormat: "MMMM d, yyyy", - dateFormatLocale: "en_US", + dateFormatLocale: defaultDateFormatLocale, ), Source( sourceName: "Manga-fast.com", @@ -268,7 +270,7 @@ List _madaraSourcesList = [ typeSource: TypeSource.madara, logoUrl: '', dateFormat: "d MMMM'،' yyyy", - dateFormatLocale: "en_US", + dateFormatLocale: defaultDateFormatLocale, ), Source( sourceName: "Manga Fenix", @@ -286,7 +288,7 @@ List _madaraSourcesList = [ typeSource: TypeSource.madara, logoUrl: '', dateFormat: "d MMMM، yyy", - dateFormatLocale: "en_US", + dateFormatLocale: defaultDateFormatLocale, ), Source( sourceName: "MangaGreat", @@ -294,8 +296,8 @@ List _madaraSourcesList = [ lang: "en", typeSource: TypeSource.madara, logoUrl: '', - dateFormat: "MMMM dd, yyyy", - dateFormatLocale: "en_US", + dateFormat: defaultDateFormat, + dateFormatLocale: defaultDateFormatLocale, ), Source( sourceName: "Manga Hentai", @@ -304,10 +306,9 @@ List _madaraSourcesList = [ isNsfw: true, typeSource: TypeSource.madara, logoUrl: '', - dateFormat: "MMMM dd, yyyy", - dateFormatLocale: "en_US", + dateFormat: defaultDateFormat, + dateFormatLocale: defaultDateFormatLocale, ), - Source( sourceName: "MangaMe", baseUrl: "https://mangame.org", @@ -315,7 +316,7 @@ List _madaraSourcesList = [ typeSource: TypeSource.madara, logoUrl: '', dateFormat: "dd.MM.yyyy", - dateFormatLocale: "en_US", + dateFormatLocale: defaultDateFormatLocale, ), Source( sourceName: "Manga One Love", @@ -325,7 +326,7 @@ List _madaraSourcesList = [ logoUrl: '', isNsfw: true, dateFormat: "dd.MM.yyyy", - dateFormatLocale: "en_US", + dateFormatLocale: defaultDateFormatLocale, ), Source( sourceName: "Manga Read", @@ -334,7 +335,7 @@ List _madaraSourcesList = [ typeSource: TypeSource.madara, logoUrl: '', dateFormat: "yyyy-MM-dd", - dateFormatLocale: "en_US", + dateFormatLocale: defaultDateFormatLocale, ), Source( sourceName: "MangaRolls", @@ -342,8 +343,8 @@ List _madaraSourcesList = [ lang: "en", typeSource: TypeSource.madara, logoUrl: '', - dateFormat: "MMMM dd, yyyy", - dateFormatLocale: "en_US", + dateFormat: defaultDateFormat, + dateFormatLocale: defaultDateFormatLocale, ), Source( sourceName: "Manga Şehri", @@ -360,17 +361,224 @@ List _madaraSourcesList = [ lang: "en", typeSource: TypeSource.madara, logoUrl: '', - dateFormat: "MMMM dd, yyyy", - dateFormatLocale: "en_US", + dateFormat: defaultDateFormat, + dateFormatLocale: defaultDateFormatLocale, ), Source( - sourceName: "Manhwa18.org", - baseUrl: "https://manhwa18.org", + sourceName: "Manhwa68", + baseUrl: "https://manhwa68.com", + lang: "en", + isNsfw: true, + typeSource: TypeSource.madara, + logoUrl: '', + dateFormat: "MMMM d, yyyy", + dateFormatLocale: defaultDateFormatLocale, + ), + + Source( + sourceName: "Manhwua.fans", + baseUrl: "https://manhwua.fans", + lang: "en", + typeSource: TypeSource.madara, + logoUrl: '', + dateFormat: "yyyy'年'M'月'd", + dateFormatLocale: defaultDateFormatLocale, + ), + Source( + sourceName: "ManyToon.me", + baseUrl: "https://manytoon.me", + lang: "en", + isNsfw: true, + typeSource: TypeSource.madara, + logoUrl: '', + dateFormat: "MMMM d, yyyy", + dateFormatLocale: defaultDateFormatLocale, + ), + + Source( + sourceName: "Milftoon", + baseUrl: "https://milftoon.xxx", + lang: "en", + isNsfw: true, + typeSource: TypeSource.madara, + logoUrl: '', + dateFormat: "d MMMM, yyyy", + dateFormatLocale: defaultDateFormatLocale, + ), + Source( + sourceName: "MurimScan", + baseUrl: "https://murimscan.run", + lang: "en", + isNsfw: true, + typeSource: TypeSource.madara, + logoUrl: '', + dateFormat: "MMMM d, yyyy", + dateFormatLocale: defaultDateFormatLocale, + ), + Source( + sourceName: "Ninja Scan", + baseUrl: "https://ninjascan.xyz", + lang: "pt-br", + typeSource: TypeSource.madara, + logoUrl: '', + dateFormat: "dd 'de' MMMMM 'de' yyyy", + dateFormatLocale: "pt-BR", + ), + Source( + sourceName: "NovelCrow", + baseUrl: "https://novelcrow.com", lang: "en", typeSource: TypeSource.madara, logoUrl: '', isNsfw: true, - dateFormat: "MMMM d, yyyy", - dateFormatLocale: "en_US", + dateFormat: defaultDateFormat, + dateFormatLocale: defaultDateFormatLocale, ), -]; + Source( + sourceName: "Pirulito Rosa", + baseUrl: "https://pirulitorosa.site", + lang: "pt-br", + typeSource: TypeSource.madara, + logoUrl: '', + isNsfw: true, + dateFormat: "dd/MM/yyy", + dateFormatLocale: "pt-BR", + ), + Source( + sourceName: "RagnarokScan", + baseUrl: "https://ragnarokscan.com", + lang: "es", + typeSource: TypeSource.madara, + logoUrl: '', + dateFormat: "MMMMM dd, yyyy", + dateFormatLocale: "es", + ), + Source( + sourceName: "Ragnarok Scanlation", + baseUrl: "https://ragnarokscanlation.com", + lang: "es", + typeSource: TypeSource.madara, + logoUrl: '', + dateFormat: "MMMM d, yyyy", + dateFormatLocale: "es", + ), + Source( + sourceName: "Rio2 Manga", + baseUrl: "https://rio2manga.com", + lang: "en", + typeSource: TypeSource.madara, + logoUrl: '', + dateFormat: defaultDateFormat, + dateFormatLocale: defaultDateFormatLocale, + ), + Source( + sourceName: "Romantik Manga", + baseUrl: "https://rio2manga.com", + lang: "tr", + typeSource: TypeSource.madara, + logoUrl: '', + dateFormat: "MMMM d, yyyy", + dateFormatLocale: defaultDateFormatLocale, + ), + Source( + sourceName: "SamuraiScan", + baseUrl: "https://samuraiscan.com", + lang: "es", + typeSource: TypeSource.madara, + logoUrl: '', + dateFormat: "MMMM d, yyyy", + dateFormatLocale: "es", + ), + Source( + sourceName: "Sdl scans", + baseUrl: "https://sdlscans.com", + lang: "es", + typeSource: TypeSource.madara, + logoUrl: '', + dateFormat: "MMMMM dd, yyyy", + dateFormatLocale: "es", + ), + Source( + sourceName: "Shayami", + baseUrl: "https://shayami.com", + lang: "es", + typeSource: TypeSource.madara, + logoUrl: '', + dateFormat: "MMM d, yyy", + dateFormatLocale: "es", + ), + Source( + sourceName: "Taurus Fansub", + baseUrl: "https://tatakaescan.com", + lang: "es", + typeSource: TypeSource.madara, + logoUrl: '', + dateFormat: "dd/MM/yyy", + dateFormatLocale: "es", + ), + Source( + sourceName: "The Sugar", + baseUrl: "https://thesugarscan.com", + lang: "pt-br", + typeSource: TypeSource.madara, + logoUrl: '', + dateFormat: "dd/MM/yyyy", + dateFormatLocale: "pt-BR", + ), + Source( + sourceName: "365Manga", + baseUrl: "https://365manga.com", + lang: "en", + typeSource: TypeSource.madara, + logoUrl: '', + dateFormat: defaultDateFormat, + dateFormatLocale: defaultDateFormatLocale, + ), + Source( + sourceName: "Tortuga Ceviri", + baseUrl: "https://tortuga-ceviri.com", + lang: "tr", + typeSource: TypeSource.madara, + logoUrl: '', + dateFormat: "MMMM d, yyyy", + dateFormatLocale: "tr", + ), + Source( + sourceName: "Tumangaonline.site", + baseUrl: "https://tumangaonline.site", + lang: "es", + isNsfw: true, + typeSource: TypeSource.madara, + logoUrl: '', + dateFormat: "dd MMMMM, yyyy", + dateFormatLocale: "es", + ), + Source( + sourceName: "Winter Scan", + baseUrl: "https://winterscan.com", + lang: "pt-br", + typeSource: TypeSource.madara, + logoUrl: '', + dateFormat: "dd 'de' MMMM 'de' yyyy", + dateFormatLocale: "pt-BR", + ), + Source( + sourceName: "Yuri Verso", + baseUrl: "https://yuri.live", + lang: "pt-br", + typeSource: TypeSource.madara, + logoUrl: '', + dateFormat: "dd/MM/yyyy", + dateFormatLocale: "pt-BR", + ), + Source( + sourceName: "Zero Scan", + baseUrl: "https://zeroscan.com.br", + lang: "pt-br", + isNsfw: true, + typeSource: TypeSource.madara, + logoUrl: '', + dateFormat: "dd/MM/yyyy", + dateFormatLocale: "pt-BR", + ), +]; \ No newline at end of file diff --git a/lib/sources/multisrc/madara/src/madara.dart b/lib/sources/multisrc/madara/src/madara.dart index f80187e..48ebfd3 100644 --- a/lib/sources/multisrc/madara/src/madara.dart +++ b/lib/sources/multisrc/madara/src/madara.dart @@ -72,7 +72,7 @@ class Madara extends MangaYomiServices { .join(', '); description = dom .querySelectorAll( - "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") + "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") .map((e) => e.text) .toList() .first;