mirror of
https://github.com/kodjodevf/mangayomi-extensions.git
synced 2026-02-14 19:01:15 +00:00
fix #77
This commit is contained in:
@@ -104,8 +104,28 @@ class Aniwave extends MProvider {
|
|||||||
final statusList = [
|
final statusList = [
|
||||||
{"Releasing": 0, "Completed": 1}
|
{"Releasing": 0, "Completed": 1}
|
||||||
];
|
];
|
||||||
final res = (await client.get(Uri.parse("$baseUrl$url"))).body;
|
final response =
|
||||||
MManga anime = MManga();
|
await Client(source, json.encode({"followRedirects": false}))
|
||||||
|
.get(Uri.parse("$baseUrl$url"));
|
||||||
|
String res = response.body;
|
||||||
|
if (getMapValue(json.encode(response.headers), "location")
|
||||||
|
.contains("/filter?keyword=")) {
|
||||||
|
res = (await Client().get(Uri.parse("$baseUrl$url"))).body;
|
||||||
|
final animeUrls = parseHtml(res)
|
||||||
|
.selectFirst("div.ani.items > div.item")
|
||||||
|
.select("a[href]")
|
||||||
|
.where((MElement element) => (element.getHref as String)
|
||||||
|
.startsWith("${substringBefore(url, ".")}."))
|
||||||
|
.toList();
|
||||||
|
if (animeUrls.isNotEmpty) {
|
||||||
|
res = (await client.get(Uri.parse("$baseUrl${animeUrls[0].getHref}")))
|
||||||
|
.body;
|
||||||
|
} else {
|
||||||
|
throw "Anime url not found";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var anime = MManga();
|
||||||
final status = xpath(res, '//div[contains(text(),"Status")]/span/text()');
|
final status = xpath(res, '//div[contains(text(),"Status")]/span/text()');
|
||||||
if (status.isNotEmpty) {
|
if (status.isNotEmpty) {
|
||||||
anime.status = parseStatus(status.first, statusList);
|
anime.status = parseStatus(status.first, statusList);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import '../../../../../model/source.dart';
|
import '../../../../../model/source.dart';
|
||||||
|
|
||||||
Source get aniwave => _aniwave;
|
Source get aniwave => _aniwave;
|
||||||
const _aniwaveVersion = "0.0.85";
|
const _aniwaveVersion = "0.0.9";
|
||||||
const _aniwaveCodeUrl =
|
const _aniwaveCodeUrl =
|
||||||
"https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/src/en/aniwave/aniwave.dart";
|
"https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/src/en/aniwave/aniwave.dart";
|
||||||
Source _aniwave = Source(
|
Source _aniwave = Source(
|
||||||
|
|||||||
Reference in New Issue
Block a user