diff --git a/dart/anime/anime_source_list.dart b/dart/anime/anime_source_list.dart index 6e6e4173..4fcf9782 100644 --- a/dart/anime/anime_source_list.dart +++ b/dart/anime/anime_source_list.dart @@ -5,7 +5,6 @@ import 'multisrc/zorotheme/sources.dart'; import 'src/all/animeworldindia/sources.dart'; import 'src/all/nyaa/source.dart'; import 'src/ar/okanime/source.dart'; -import 'src/de/aniflix/source.dart'; import 'src/de/animetoast/source.dart'; import 'src/en/animepahe/source.dart'; import 'src/en/aniwave/source.dart'; @@ -47,7 +46,6 @@ List dartAnimesourceList = [ yomoviesSource, animesamaSource, nineanimetv, - aniflix, ...animeworldindiaSourcesList, nyaaSource, animepaheSource, diff --git a/dart/anime/src/de/aniflix/aniflix.dart b/dart/anime/src/de/aniflix/aniflix.dart deleted file mode 100644 index 3195d02b..00000000 --- a/dart/anime/src/de/aniflix/aniflix.dart +++ /dev/null @@ -1,240 +0,0 @@ -import 'package:mangayomi/bridge_lib.dart'; -import 'dart:convert'; - -class AniFlix extends MProvider { - AniFlix({required this.source}); - - MSource source; - - final Client client = Client(source); - - @override - Future getPopular(int page) async { - final headers = getHeader(source.baseUrl); - final res = (await client.get( - Uri.parse("${source.baseUrl}/api/show/new/${page - 1}"), - headers: headers)) - .body; - - return parseAnimeList(res, true); - } - - @override - Future getLatestUpdates(int page) async { - final headers = getHeader(source.baseUrl); - final res = (await client.get( - Uri.parse("${source.baseUrl}/api/show/airing/${page - 1}"), - headers: headers)) - .body; - final datas = json.decode(res); - List animeList = []; - List ids = []; - for (var data in datas) { - final anim = data["season"]["show"]; - if (!ids.contains(anim["id"])) { - ids.add(anim["id"]); - MManga anime = MManga(); - anime.name = anim["name"]; - anime.imageUrl = - "${source.baseUrl}/storage/" + (anim["cover_portrait"] ?? ""); - anime.link = - getUrlWithoutDomain("${source.baseUrl}/api/show/${anim['url']}"); - anime.description = anim["description"]; - if (anim["airing"] == 0) { - anime.status = MStatus.completed; - } else if (anim["airing"] == 1) { - anime.status = MStatus.ongoing; - } - animeList.add(anime); - } - } - return MPages(animeList, true); - } - - @override - Future search(String query, int page, FilterList filterList) async { - final res = await client.post( - Uri.parse("${source.baseUrl}/api/show/search"), - headers: {'Referer': source.baseUrl}, - body: {"search": query}); - return parseAnimeList(res.body, false); - } - - @override - Future getDetail(String url) async { - final res = (await client.get(Uri.parse("${source.baseUrl}$url"))).body; - MManga anime = MManga(); - final jsonRes = json.decode(res); - anime.name = jsonRes["name"]; - if (jsonRes["cover_portrait"] != null) { - anime.imageUrl = "${source.baseUrl}/storage/" + jsonRes["cover_portrait"]; - } - anime.description = jsonRes["description"]; - anime.genre = (jsonRes["genres"] as List>) - .map((e) => e["name"]) - .toList(); - var seasons = jsonRes["seasons"]; - final animeUrl = jsonRes["url"]; - List? episodesList = []; - for (var season in seasons) { - List> episodes = season["episodes"]; - int page = 1; - final res = (await client.get(Uri.parse( - "${source.baseUrl}/api/show/$animeUrl/${season["id"]}/$page"))) - .body; - - bool hasMoreResult = - (json.decode(res)["episodes"] as List>) - .isNotEmpty; - - while (hasMoreResult) { - final res = (await client.get(Uri.parse( - "${source.baseUrl}/api/show/$animeUrl/${season["id"]}/$page"))) - .body; - final epList = - json.decode(res)["episodes"] as List>; - page++; - episodes.addAll(epList); - hasMoreResult = epList.isNotEmpty; - } - for (var episode in episodes) { - String name = episode["name"] ?? ""; - if (name.toLowerCase().contains("folge") || - name.toLowerCase().contains("episode")) { - name = ""; - } else { - name = ": $name"; - } - MChapter ep = MChapter(); - ep.name = "Staffel ${season["number"]} Folge ${episode["number"]}$name"; - ep.url = - "/api/episode/show/$animeUrl/season/${season["number"]}/episode/${episode["number"]}"; - episodesList.add(ep); - } - } - - anime.chapters = episodesList.reversed.toList(); - return anime; - } - - @override - Future> getVideoList(String url) async { - final res = (await client.get(Uri.parse("${source.baseUrl}$url"), - headers: getHeader(source.baseUrl))) - .body; - final jsonRes = json.decode(res)["streams"]; - List videos = []; - final hosterSelection = preferenceHosterSelection(source.id); - for (var stream in jsonRes) { - List a = []; - String quality = '${stream["hoster"]["name"]} - ${stream["lang"]}'; - String link = stream["link"]; - if ((link.contains("https://dood") || link.contains("https://d0")) && - hosterSelection.contains("doodstream")) { - a = await doodExtractor(link, quality); - } else if (link.contains("https://streamtape") && - hosterSelection.contains("streamtape")) { - a = await streamTapeExtractor(link, quality); - } else if (link.contains("https://voe.sx") && - hosterSelection.contains("voe")) { - a = await voeExtractor(link, quality); - } else if (link.contains("https://streamlare") && - hosterSelection.contains("streamlare")) { - a = await streamlareExtractor(link, quality, '', ''); - } - videos.addAll(a); - } - - return sortVideos(videos, source.id); - } - - MPages parseAnimeList(String res, bool hasNextPage) { - final datas = json.decode(res); - List animeList = []; - - for (var data in datas) { - MManga anime = MManga(); - anime.name = data["name"]; - anime.imageUrl = - "${source.baseUrl}/storage/" + (data["cover_portrait"] ?? ""); - anime.link = - getUrlWithoutDomain("${source.baseUrl}/api/show/${data['url']}"); - anime.description = data["description"]; - if (data["airing"] == 0) { - anime.status = MStatus.completed; - } else if (data["airing"] == 1) { - anime.status = MStatus.ongoing; - } - animeList.add(anime); - } - return MPages(animeList, hasNextPage); - } - - List sortVideos(List videos, int sourceId) { - String hoster = getPreferenceValue(sourceId, "preferred_hoster"); - String sub = getPreferenceValue(sourceId, "preferred_sub"); - videos.sort((MVideo a, MVideo b) { - int hosterMatchA = 0; - if (a.url.toLowerCase().contains(hoster.toLowerCase()) && - a.quality.toLowerCase().contains(sub.toLowerCase())) { - hosterMatchA = 1; - } - int hosterMatchB = 0; - if (b.url.toLowerCase().contains(hoster.toLowerCase()) && - b.quality.toLowerCase().contains(sub.toLowerCase())) { - hosterMatchB = 1; - } - return hosterMatchB - hosterMatchA; - }); - return videos; - } - - List preferenceHosterSelection(int sourceId) { - return getPreferenceValue(sourceId, "hoster_selectionn"); - } - - @override - List getSourcePreferences() { - return [ - ListPreference( - key: "preferred_hoster", - title: "Standard-Hoster", - summary: "", - valueIndex: 0, - entries: [ - "Streamtape", - "Doodstream", - "Voe", - "Streamlare" - ], - entryValues: [ - "https://streamtape.com", - "https://dood", - "https://voe.sx", - "https://streamlare.com" - ]), - ListPreference( - key: "preferred_sub", - title: "Standardmäßig Sub oder Dub?", - summary: "", - valueIndex: 0, - entries: ["Sub", "Dub"], - entryValues: ["Sub", "Dub"]), - MultiSelectListPreference( - key: "hoster_selectionn", - title: "Hoster auswählen", - summary: "", - entries: ["Streamtape", "Doodstream", "Voe", "Streamlare"], - entryValues: ["streamtape", "doodstream", "voe", "streamlare"], - values: ["streamtape", "doodstream", "voe", "streamlare"]), - ]; - } -} - -Map getHeader(String url) { - return {'Referer': url}; -} - -AniFlix main(MSource source) { - return AniFlix(source: source); -} diff --git a/dart/anime/src/de/aniflix/icon.png b/dart/anime/src/de/aniflix/icon.png deleted file mode 100644 index cd181272..00000000 Binary files a/dart/anime/src/de/aniflix/icon.png and /dev/null differ diff --git a/dart/anime/src/de/aniflix/source.dart b/dart/anime/src/de/aniflix/source.dart deleted file mode 100644 index 2702e820..00000000 --- a/dart/anime/src/de/aniflix/source.dart +++ /dev/null @@ -1,16 +0,0 @@ -import '../../../../../model/source.dart'; - -Source get aniflix => _aniflix; -const _aniflixVersion = "0.0.3"; -const _aniflixCodeUrl = - "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/src/de/aniflix/aniflix.dart"; -Source _aniflix = Source( - name: "Aniflix", - baseUrl: "https://aniflix.cc", - lang: "de", - typeSource: "single", - iconUrl: - "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/src/de/aniflix/icon.png", - sourceCodeUrl: _aniflixCodeUrl, - version: _aniflixVersion, - isManga: false); diff --git a/dart/manga/src/all/comick/comick.dart b/dart/manga/src/all/comick/comick.dart index 1354ef50..8a51c7cb 100644 --- a/dart/manga/src/all/comick/comick.dart +++ b/dart/manga/src/all/comick/comick.dart @@ -1,5 +1,4 @@ import 'package:mangayomi/bridge_lib.dart'; -import 'dart:convert'; class ComickFun extends MProvider { ComickFun({required this.source}); @@ -123,6 +122,7 @@ class ComickFun extends MProvider { "${source.apiUrl}${url.replaceAll("#", '')}?tachiyomi=true"), headers: headers)) .body; + final lang = "${source.lang != "all" ? "&lang=${source.lang}" : ""}"; MManga manga = MManga(); manga.author = jsonPathToString(res, r'$.authors[*].name', ''); manga.genre = jsonPathToString( @@ -132,13 +132,13 @@ class ComickFun extends MProvider { manga.status = parseStatus(jsonPathToString(res, r'$..comic.status', ''), statusList); final chapUrlReq = - "${source.apiUrl}${url.replaceAll("#", '')}chapters?lang=${source.lang}&tachiyomi=true&page=1"; + "${source.apiUrl}${url.replaceAll("#", '')}chapters?${lang}&tachiyomi=true&page=1"; final request = (await client.get(Uri.parse(chapUrlReq), headers: headers)).body; var total = jsonPathToString(request, r'$.total', ''); final chapterLimit = int.parse(total); final newChapUrlReq = - "${source.apiUrl}${url.replaceAll("#", '')}chapters?limit=$chapterLimit&lang=${source.lang}&tachiyomi=true&page=1"; + "${source.apiUrl}${url.replaceAll("#", '')}chapters?limit=$chapterLimit${lang}&tachiyomi=true&page=1"; final newRequest = (await client.get(Uri.parse(newChapUrlReq), headers: headers)).body; diff --git a/dart/manga/src/all/comick/sources.dart b/dart/manga/src/all/comick/sources.dart index 6d0915a0..1fe49c0a 100644 --- a/dart/manga/src/all/comick/sources.dart +++ b/dart/manga/src/all/comick/sources.dart @@ -1,6 +1,6 @@ import '../../../../../model/source.dart'; -const _comickVersion = "0.0.7"; +const _comickVersion = "0.0.75"; const _comickSourceCodeUrl = "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/manga/src/all/comick/comick.dart";