mirror of
https://github.com/kodjodevf/mangayomi-extensions.git
synced 2026-02-14 19:01:15 +00:00
fix
This commit is contained in:
@@ -65,7 +65,8 @@ class AnimePahe extends MProvider {
|
|||||||
];
|
];
|
||||||
MManga anime = MManga();
|
MManga anime = MManga();
|
||||||
final id = substringBefore(substringAfterLast(url, "?anime_id="), "&name=");
|
final id = substringBefore(substringAfterLast(url, "?anime_id="), "&name=");
|
||||||
final session = await getSession(id);
|
final name = substringAfterLast(url, "&name=");
|
||||||
|
final session = await getSession(name, id);
|
||||||
final res = (await client.get(
|
final res = (await client.get(
|
||||||
Uri.parse("$baseUrl/anime/$session?anime_id=$id"),
|
Uri.parse("$baseUrl/anime/$session?anime_id=$id"),
|
||||||
headers: headers,
|
headers: headers,
|
||||||
@@ -137,7 +138,7 @@ class AnimePahe extends MProvider {
|
|||||||
return animeList;
|
return animeList;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<String> getSession(String animeId) async {
|
Future<String> getSession(String title, String animeId) async {
|
||||||
final noRedirect = Client(
|
final noRedirect = Client(
|
||||||
source,
|
source,
|
||||||
json.encode({"followRedirects": false, "useDartHttpClient": true}),
|
json.encode({"followRedirects": false, "useDartHttpClient": true}),
|
||||||
@@ -147,6 +148,19 @@ class AnimePahe extends MProvider {
|
|||||||
Uri.parse("$baseUrl/a/$animeId"),
|
Uri.parse("$baseUrl/a/$animeId"),
|
||||||
headers: headers,
|
headers: headers,
|
||||||
);
|
);
|
||||||
|
if (res.statusCode == 302) {
|
||||||
|
final res = (await client.get(
|
||||||
|
Uri.parse("$baseUrl/api?m=search&q=$title"),
|
||||||
|
headers: headers,
|
||||||
|
)).body;
|
||||||
|
return substringBefore(
|
||||||
|
substringAfter(
|
||||||
|
substringAfter(res, "\"id\":$animeId"),
|
||||||
|
"\"session\":\"",
|
||||||
|
),
|
||||||
|
"\"",
|
||||||
|
);
|
||||||
|
}
|
||||||
final location =
|
final location =
|
||||||
"https://${substringAfterLast(res.headers["location"], "https://")}";
|
"https://${substringAfterLast(res.headers["location"], "https://")}";
|
||||||
final uri = Uri.parse(location);
|
final uri = Uri.parse(location);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import '../../../../../model/source.dart';
|
import '../../../../../model/source.dart';
|
||||||
|
|
||||||
Source get animepaheSource => _animepaheSource;
|
Source get animepaheSource => _animepaheSource;
|
||||||
const _animepaheVersion = "0.0.6";
|
const _animepaheVersion = "0.0.65";
|
||||||
const _animepaheSourceCodeUrl =
|
const _animepaheSourceCodeUrl =
|
||||||
"https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/src/en/animepahe/animepahe.dart";
|
"https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/$branchName/dart/anime/src/en/animepahe/animepahe.dart";
|
||||||
Source _animepaheSource = Source(
|
Source _animepaheSource = Source(
|
||||||
|
|||||||
Reference in New Issue
Block a user