Gogoanime : add search method

This commit is contained in:
kodjomoustapha
2023-07-27 09:25:58 +01:00
parent 1a6b225a59
commit 9917734d61
2 changed files with 20 additions and 1 deletions

View File

@@ -150,3 +150,22 @@ getVideoList(MangaModel anime) async {
return videos; return videos;
} }
searchAnime(MangaModel anime) async {
final url =
"${anime.baseUrl}/search.html?keyword=${anime.query}&page=${anime.page}";
final data = {"url": url, "headers": null, "sourceId": anime.sourceId};
final res = await MBridge.http(json.encode(data), 0);
if (res.isEmpty) {
return anime;
}
anime.urls =
MBridge.xpath(res, '//*[@class="img"]/a/@href', '._').split('._');
anime.names =
MBridge.xpath(res, '//*[@class="img"]/a/@title', '._').split('._');
anime.images =
MBridge.xpath(res, '//*[@class="img"]/a/img/@src', '._').split('._');
return anime;
}

View File

@@ -1,7 +1,7 @@
import '../../../../model/source.dart'; import '../../../../model/source.dart';
Source get gogoanimeSource => _gogoanimeSource; Source get gogoanimeSource => _gogoanimeSource;
const gogoanimeVersion = "0.0.11"; const gogoanimeVersion = "0.0.12";
const gogoanimeSourceCodeUrl = const gogoanimeSourceCodeUrl =
"https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/anime/src/en/gogoanime/gogoanime-v$gogoanimeVersion.dart"; "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/anime/src/en/gogoanime/gogoanime-v$gogoanimeVersion.dart";
Source _gogoanimeSource = Source( Source _gogoanimeSource = Source(