mirror of
https://github.com/kodjodevf/mangayomi-extensions.git
synced 2026-02-15 19:30:29 +00:00
Show actual anime covers
Not ready. Very slow.
This commit is contained in:
@@ -20,12 +20,16 @@ class AnimeToast extends MProvider {
|
|||||||
final elements = document.select("div.row div.col-md-4 div.video-item");
|
final elements = document.select("div.row div.col-md-4 div.video-item");
|
||||||
List<MManga> animeList = [];
|
List<MManga> animeList = [];
|
||||||
for (var element in elements) {
|
for (var element in elements) {
|
||||||
MManga anime = MManga();
|
MManga anime = await (() async {
|
||||||
anime.name = element.selectFirst("div.item-thumbnail a").attr("title");
|
MManga anime = MManga();
|
||||||
anime.link = getUrlWithoutDomain(
|
anime.name = element.selectFirst("div.item-thumbnail a").attr("title");
|
||||||
element.selectFirst("div.item-thumbnail a").attr("href"));
|
anime.link = getUrlWithoutDomain(
|
||||||
anime.imageUrl =
|
element.selectFirst("div.item-thumbnail a").attr("href"));
|
||||||
element.selectFirst("div.item-thumbnail a img").attr("src");
|
final detailsRes = (await client.get(Uri.parse("$baseUrl${anime.link}"))).body;
|
||||||
|
final detailsDoc = parseHtml(detailsRes);
|
||||||
|
anime.imageUrl = detailsDoc.selectFirst(".item-content p img").attr("src");
|
||||||
|
return anime;
|
||||||
|
})();
|
||||||
animeList.add(anime);
|
animeList.add(anime);
|
||||||
}
|
}
|
||||||
return MPages(animeList, false);
|
return MPages(animeList, false);
|
||||||
@@ -33,20 +37,23 @@ class AnimeToast extends MProvider {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> search(String query, int page, FilterList filterList) async {
|
Future<MPages> search(String query, int page, FilterList filterList) async {
|
||||||
final res =
|
final res = (await client.get(Uri.parse("$baseUrl/page/$page/?s=$query"))).body;
|
||||||
(await client.get(Uri.parse("$baseUrl/page/$page/?s=$query"))).body;
|
final document = parseHtml(res);
|
||||||
final document = parseHtml(res);
|
final elements = document.select("div.item-thumbnail a[href]");
|
||||||
final elements = document.select("div.item-thumbnail a[href]");
|
List<MManga> animeList = [];
|
||||||
List<MManga> animeList = [];
|
for (var element in elements) {
|
||||||
for (var element in elements) {
|
MManga anime = await (() async {
|
||||||
MManga anime = MManga();
|
MManga anime = MManga();
|
||||||
anime.name = element.attr("title");
|
anime.name = element.attr("title");
|
||||||
anime.link = getUrlWithoutDomain(element.attr("href"));
|
anime.link = getUrlWithoutDomain(element.attr("href"));
|
||||||
anime.imageUrl = element.selectFirst("a img").attr("src");
|
final detailsRes = (await client.get(Uri.parse("$baseUrl${anime.link}"))).body;
|
||||||
animeList.add(anime);
|
final detailsDoc = parseHtml(detailsRes);
|
||||||
}
|
anime.imageUrl = detailsDoc.selectFirst(".item-content p img").attr("src");
|
||||||
return MPages(
|
return anime;
|
||||||
animeList, document.selectFirst("li.next a")?.attr("href") != null);
|
})();
|
||||||
|
animeList.add(anime);
|
||||||
|
}
|
||||||
|
return MPages(animeList, document.selectFirst("li.next a")?.attr("href") != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
Reference in New Issue
Block a user