mirror of
https://github.com/kodjodevf/mangayomi-extensions.git
synced 2026-02-15 11:21:11 +00:00
Update Aniwave keys & fix vidsrcExtractor
This commit is contained in:
@@ -9,7 +9,7 @@ class Aniwave extends MProvider {
|
|||||||
final Client client = Client(source);
|
final Client client = Client(source);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String get baseUrl => getPreferenceValue(source.id, "preferred_domain1");
|
String get baseUrl => getPreferenceValue(source.id, "preferred_domain2");
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<MPages> getPopular(int page) async {
|
Future<MPages> getPopular(int page) async {
|
||||||
@@ -174,9 +174,12 @@ class Aniwave extends MProvider {
|
|||||||
final ids = substringBefore(url, "&");
|
final ids = substringBefore(url, "&");
|
||||||
final encrypt = vrfEncrypt(ids);
|
final encrypt = vrfEncrypt(ids);
|
||||||
final vrf = "vrf=${Uri.encodeComponent(encrypt)}";
|
final vrf = "vrf=${Uri.encodeComponent(encrypt)}";
|
||||||
final res =
|
final res = (await client
|
||||||
(await client.get(Uri.parse("$baseUrl/ajax/server/list/$ids?$vrf")))
|
.get(Uri.parse("$baseUrl/ajax/server/list/$ids?$vrf"), headers: {
|
||||||
.body;
|
"Referer": baseUrl + url,
|
||||||
|
"X-Requested-With": "XMLHttpRequest"
|
||||||
|
}))
|
||||||
|
.body;
|
||||||
final html = json.decode(res)["result"];
|
final html = json.decode(res)["result"];
|
||||||
|
|
||||||
final vidsHtmls = parseHtml(html).select("div.servers > div");
|
final vidsHtmls = parseHtml(html).select("div.servers > div");
|
||||||
@@ -202,21 +205,21 @@ class Aniwave extends MProvider {
|
|||||||
final hosterSelection = preferenceHosterSelection(source.id);
|
final hosterSelection = preferenceHosterSelection(source.id);
|
||||||
final typeSelection = preferenceTypeSelection(source.id);
|
final typeSelection = preferenceTypeSelection(source.id);
|
||||||
if (typeSelection.contains(type.toLowerCase())) {
|
if (typeSelection.contains(type.toLowerCase())) {
|
||||||
if (serverName.contains("vidplay") || url.contains("mcloud")) {
|
if (serverName.contains("vidstream") || url.contains("megaf")) {
|
||||||
final hosterName =
|
final hosterName =
|
||||||
serverName.contains("vidplay") ? "VidPlay" : "MyCloud";
|
serverName.contains("vidstream") ? "Vidstream" : "MegaF";
|
||||||
if (hosterSelection.contains(hosterName.toLowerCase())) {
|
if (hosterSelection.contains(hosterName.toLowerCase())) {
|
||||||
a = await vidsrcExtractor(url, hosterName, type);
|
a = await vidsrcExtractor(url, hosterName, type);
|
||||||
}
|
}
|
||||||
} else if (serverName.contains("mp4upload") &&
|
} else if (serverName.contains("mp4u") &&
|
||||||
hosterSelection.contains("mp4upload")) {
|
hosterSelection.contains("mp4u")) {
|
||||||
a = await mp4UploadExtractor(url, null, "", type);
|
a = await mp4UploadExtractor(url, null, "", type);
|
||||||
} else if (serverName.contains("streamtape") &&
|
} else if (serverName.contains("streamtape") &&
|
||||||
hosterSelection.contains("streamtape")) {
|
hosterSelection.contains("streamtape")) {
|
||||||
a = await streamTapeExtractor(url, "StreamTape - $type");
|
a = await streamTapeExtractor(url, "StreamTape - $type");
|
||||||
} else if (serverName.contains("filemoon") &&
|
} else if (serverName.contains("moonf") &&
|
||||||
hosterSelection.contains("filemoon")) {
|
hosterSelection.contains("moonf")) {
|
||||||
a = await filemoonExtractor(url, "", type);
|
a = await filemoonExtractor(url, "MoonF", type);
|
||||||
}
|
}
|
||||||
videos.addAll(a);
|
videos.addAll(a);
|
||||||
}
|
}
|
||||||
@@ -274,17 +277,14 @@ class Aniwave extends MProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String vrfEncrypt(String input) {
|
String vrfEncrypt(String input) {
|
||||||
final rc4 = rc4Encrypt("tGn6kIpVXBEUmqjD", input.codeUnits);
|
final rc4 = rc4Encrypt("T78s2WjTc7hSIZZR", input.codeUnits);
|
||||||
final vrf = base64Url.encode(rc4);
|
final vrf = base64Url.encode(rc4);
|
||||||
final vrf1 = base64.encode(vrf.codeUnits);
|
return utf8.decode(vrf.codeUnits);
|
||||||
List<int> vrf2 = vrfShift(vrf1.codeUnits);
|
|
||||||
final vrf3 = base64Url.encode(vrf2.reversed.toList());
|
|
||||||
return utf8.decode(vrf3.codeUnits);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String vrfDecrypt(String input) {
|
String vrfDecrypt(String input, {String key = "ctpAbOz5u7S6OMkx"}) {
|
||||||
final decode = base64Url.decode(input);
|
final decode = base64Url.decode(input);
|
||||||
final rc4 = rc4Encrypt("LUyDrL4qIxtIxOGs", decode);
|
final rc4 = rc4Encrypt(key, decode);
|
||||||
return Uri.decodeComponent(utf8.decode(rc4));
|
return Uri.decodeComponent(utf8.decode(rc4));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -299,67 +299,62 @@ class Aniwave extends MProvider {
|
|||||||
|
|
||||||
Future<List<MVideo>> vidsrcExtractor(
|
Future<List<MVideo>> vidsrcExtractor(
|
||||||
String url, String name, String type) async {
|
String url, String name, String type) async {
|
||||||
List<String> keys = json.decode((await client.get(Uri.parse(
|
|
||||||
"https://raw.githubusercontent.com/KillerDogeEmpire/vidplay-keys/keys/keys.json")))
|
|
||||||
.body);
|
|
||||||
List<MVideo> videoList = [];
|
List<MVideo> videoList = [];
|
||||||
final host = Uri.parse(url).host;
|
final host = Uri.parse(url).host;
|
||||||
final apiUrl = await getApiUrl(url, keys);
|
final apiUrl = getApiUrl(url);
|
||||||
|
final res = await client.get(Uri.parse(apiUrl));
|
||||||
|
|
||||||
final res = await client.get(Uri.parse(apiUrl), headers: {
|
if (res.body.startsWith("{")) {
|
||||||
"Host": host,
|
final result = json.decode(
|
||||||
"Referer": Uri.decodeComponent(url),
|
vrfDecrypt(json.decode(res.body)['result'], key: "9jXDYBZUcTcTZveM"));
|
||||||
"X-Requested-With": "XMLHttpRequest"
|
if (result != 404) {
|
||||||
});
|
String masterUrl =
|
||||||
final result = json.decode(res.body)['result'];
|
((result['sources'] as List<Map<String, dynamic>>).first)['file'];
|
||||||
|
final tracks = (result['tracks'] as List)
|
||||||
|
.where((e) => e['kind'] == 'captions' ? true : false)
|
||||||
|
.toList();
|
||||||
|
List<MTrack> subtitles = [];
|
||||||
|
|
||||||
if (result != 404) {
|
for (var sub in tracks) {
|
||||||
String masterUrl =
|
try {
|
||||||
((result['sources'] as List<Map<String, dynamic>>).first)['file'];
|
MTrack subtitle = MTrack();
|
||||||
final tracks = (result['tracks'] as List)
|
subtitle
|
||||||
.where((e) => e['kind'] == 'captions' ? true : false)
|
..label = sub["label"]
|
||||||
.toList();
|
..file = sub["file"];
|
||||||
List<MTrack> subtitles = [];
|
subtitles.add(subtitle);
|
||||||
|
} catch (_) {}
|
||||||
for (var sub in tracks) {
|
|
||||||
try {
|
|
||||||
MTrack subtitle = MTrack();
|
|
||||||
subtitle
|
|
||||||
..label = sub["label"]
|
|
||||||
..file = sub["file"];
|
|
||||||
subtitles.add(subtitle);
|
|
||||||
} catch (_) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
final masterPlaylistRes = (await client.get(Uri.parse(masterUrl))).body;
|
|
||||||
|
|
||||||
for (var it in substringAfter(masterPlaylistRes, "#EXT-X-STREAM-INF:")
|
|
||||||
.split("#EXT-X-STREAM-INF:")) {
|
|
||||||
final quality =
|
|
||||||
"${substringBefore(substringBefore(substringAfter(substringAfter(it, "RESOLUTION="), "x"), ","), "\n")}p";
|
|
||||||
|
|
||||||
String videoUrl = substringBefore(substringAfter(it, "\n"), "\n");
|
|
||||||
|
|
||||||
if (!videoUrl.startsWith("http")) {
|
|
||||||
videoUrl =
|
|
||||||
"${masterUrl.split("/").sublist(0, masterUrl.split("/").length - 1).join("/")}/$videoUrl";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MVideo video = MVideo();
|
final masterPlaylistRes = (await client.get(Uri.parse(masterUrl))).body;
|
||||||
video
|
|
||||||
..url = videoUrl
|
for (var it in substringAfter(masterPlaylistRes, "#EXT-X-STREAM-INF:")
|
||||||
..originalUrl = videoUrl
|
.split("#EXT-X-STREAM-INF:")) {
|
||||||
..quality = "$name - $type - $quality"
|
final quality =
|
||||||
..headers = {"Referer": "https://$host/"}
|
"${substringBefore(substringBefore(substringAfter(substringAfter(it, "RESOLUTION="), "x"), ","), "\n")}p";
|
||||||
..subtitles = subtitles;
|
|
||||||
videoList.add(video);
|
String videoUrl = substringBefore(substringAfter(it, "\n"), "\n");
|
||||||
|
|
||||||
|
if (!videoUrl.startsWith("http")) {
|
||||||
|
videoUrl =
|
||||||
|
"${masterUrl.split("/").sublist(0, masterUrl.split("/").length - 1).join("/")}/$videoUrl";
|
||||||
|
}
|
||||||
|
|
||||||
|
MVideo video = MVideo();
|
||||||
|
video
|
||||||
|
..url = videoUrl
|
||||||
|
..originalUrl = videoUrl
|
||||||
|
..quality = "$name - $type - $quality"
|
||||||
|
..headers = {"Referer": "https://$host/"}
|
||||||
|
..subtitles = subtitles;
|
||||||
|
videoList.add(video);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return videoList;
|
return videoList;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<String> getApiUrl(String url, List<String> keyList) async {
|
String getApiUrl(String url) {
|
||||||
final host = Uri.parse(url).host;
|
final host = Uri.parse(url).host;
|
||||||
final paramsToString = Uri.parse(url)
|
final paramsToString = Uri.parse(url)
|
||||||
.queryParameters
|
.queryParameters
|
||||||
@@ -367,23 +362,21 @@ class Aniwave extends MProvider {
|
|||||||
.map((e) => "${e.key}=${e.value}")
|
.map((e) => "${e.key}=${e.value}")
|
||||||
.join("&");
|
.join("&");
|
||||||
var vidId = substringBefore(substringAfterLast(url, "/"), "?");
|
var vidId = substringBefore(substringAfterLast(url, "/"), "?");
|
||||||
var encodedID = encodeID(vidId, keyList);
|
|
||||||
final apiSlug = await callFromFuToken(host, encodedID, url);
|
final apiSlug = encodeID(vidId, "8Qy3mlM2kod80XIK");
|
||||||
|
final h = encodeID(vidId, "BgKVSrzpH2Enosgm");
|
||||||
String apiUrlString = "";
|
String apiUrlString = "";
|
||||||
apiUrlString += "https://$host/$apiSlug";
|
apiUrlString += "https://$host/mediainfo/$apiSlug";
|
||||||
if (paramsToString.isNotEmpty) {
|
if (paramsToString.isNotEmpty) {
|
||||||
apiUrlString += "?$paramsToString";
|
apiUrlString += "?$paramsToString&h=$h";
|
||||||
}
|
}
|
||||||
|
|
||||||
return apiUrlString;
|
return apiUrlString;
|
||||||
}
|
}
|
||||||
|
|
||||||
String encodeID(String vidId, List<String> keyList) {
|
String encodeID(String vidId, String key) {
|
||||||
var rc4Key1 = keyList[0];
|
final rc4 = rc4Encrypt(key, vidId.codeUnits);
|
||||||
var rc4Key2 = keyList[1];
|
return base64.encode(rc4).replaceAll("+", "-").replaceAll("/", "_").trim();
|
||||||
final rc4 = rc4Encrypt(rc4Key1, vidId.codeUnits);
|
|
||||||
final rc41 = rc4Encrypt(rc4Key2, rc4);
|
|
||||||
return base64.encode(rc41).replaceAll("/", "_").trim();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<String> callFromFuToken(String host, String data, String url) async {
|
Future<String> callFromFuToken(String host, String data, String url) async {
|
||||||
@@ -541,22 +534,12 @@ class Aniwave extends MProvider {
|
|||||||
List<dynamic> getSourcePreferences() {
|
List<dynamic> getSourcePreferences() {
|
||||||
return [
|
return [
|
||||||
ListPreference(
|
ListPreference(
|
||||||
key: "preferred_domain1",
|
key: "preferred_domain2",
|
||||||
title: "Preferred domain",
|
title: "Preferred domain",
|
||||||
summary: "",
|
summary: "",
|
||||||
valueIndex: 0,
|
valueIndex: 0,
|
||||||
entries: [
|
entries: ["aniwave.to", "aniwavetv.to (unofficial)"],
|
||||||
"aniwave.to",
|
entryValues: ["https://aniwave.to", "https://aniwavetv.to"]),
|
||||||
"aniwave.ws",
|
|
||||||
"aniwave.li",
|
|
||||||
"aniwave.vc"
|
|
||||||
],
|
|
||||||
entryValues: [
|
|
||||||
"https://aniwave.to",
|
|
||||||
"https://aniwave.ws",
|
|
||||||
"https://aniwave.li",
|
|
||||||
"https://aniwave.vc"
|
|
||||||
]),
|
|
||||||
ListPreference(
|
ListPreference(
|
||||||
key: "preferred_quality",
|
key: "preferred_quality",
|
||||||
title: "Preferred Quality",
|
title: "Preferred Quality",
|
||||||
@@ -572,49 +555,31 @@ class Aniwave extends MProvider {
|
|||||||
entries: ["Sub", "Softsub", "Dub"],
|
entries: ["Sub", "Softsub", "Dub"],
|
||||||
entryValues: ["Sub", "Softsub", "Dub"]),
|
entryValues: ["Sub", "Softsub", "Dub"]),
|
||||||
ListPreference(
|
ListPreference(
|
||||||
key: "preferred_server",
|
key: "preferred_server1",
|
||||||
title: "Preferred server",
|
title: "Preferred server",
|
||||||
summary: "",
|
summary: "",
|
||||||
valueIndex: 0,
|
valueIndex: 0,
|
||||||
entries: [
|
entries: [
|
||||||
"VidPlay",
|
"Vidstream",
|
||||||
"MyCloud",
|
"Megaf",
|
||||||
"Filemoon",
|
"MoonF",
|
||||||
"StreamTape",
|
"StreamTape",
|
||||||
"Mp4Upload"
|
"MP4u"
|
||||||
],
|
],
|
||||||
entryValues: [
|
entryValues: [
|
||||||
"vidplay",
|
"vidstream",
|
||||||
"mycloud",
|
"megaf",
|
||||||
"filemoon",
|
"moonf",
|
||||||
"streamtape",
|
"streamtape",
|
||||||
"mp4upload"
|
"mp4upload"
|
||||||
]),
|
]),
|
||||||
MultiSelectListPreference(
|
MultiSelectListPreference(
|
||||||
key: "hoster_selection",
|
key: "hoster_selection1",
|
||||||
title: "Enable/Disable Hosts",
|
title: "Enable/Disable Hosts",
|
||||||
summary: "",
|
summary: "",
|
||||||
entries: [
|
entries: ["Vidstream", "Megaf", "MoonF", "StreamTape", "MP4u"],
|
||||||
"VidPlay",
|
entryValues: ["vidstream", "megaf", "moonf", "streamtape", "mp4u"],
|
||||||
"MyCloud",
|
values: ["vidstream", "megaf", "moonf", "streamtape", "mp4u"]),
|
||||||
"Filemoon",
|
|
||||||
"StreamTape",
|
|
||||||
"Mp4Upload"
|
|
||||||
],
|
|
||||||
entryValues: [
|
|
||||||
"vidplay",
|
|
||||||
"mycloud",
|
|
||||||
"filemoon",
|
|
||||||
"streamtape",
|
|
||||||
"mp4upload"
|
|
||||||
],
|
|
||||||
values: [
|
|
||||||
"vidplay",
|
|
||||||
"mycloud",
|
|
||||||
"filemoon",
|
|
||||||
"streamtape",
|
|
||||||
"mp4upload"
|
|
||||||
]),
|
|
||||||
MultiSelectListPreference(
|
MultiSelectListPreference(
|
||||||
key: "type_selection",
|
key: "type_selection",
|
||||||
title: "Enable/Disable Type",
|
title: "Enable/Disable Type",
|
||||||
@@ -626,7 +591,7 @@ class Aniwave extends MProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<String> preferenceHosterSelection(int sourceId) {
|
List<String> preferenceHosterSelection(int sourceId) {
|
||||||
return getPreferenceValue(sourceId, "hoster_selection");
|
return getPreferenceValue(sourceId, "hoster_selection1");
|
||||||
}
|
}
|
||||||
|
|
||||||
List<String> preferenceTypeSelection(int sourceId) {
|
List<String> preferenceTypeSelection(int sourceId) {
|
||||||
@@ -635,7 +600,7 @@ class Aniwave extends MProvider {
|
|||||||
|
|
||||||
List<MVideo> sortVideos(List<MVideo> videos, int sourceId) {
|
List<MVideo> sortVideos(List<MVideo> videos, int sourceId) {
|
||||||
String quality = getPreferenceValue(sourceId, "preferred_quality");
|
String quality = getPreferenceValue(sourceId, "preferred_quality");
|
||||||
String server = getPreferenceValue(sourceId, "preferred_server");
|
String server = getPreferenceValue(sourceId, "preferred_server1");
|
||||||
String lang = getPreferenceValue(sourceId, "preferred_language");
|
String lang = getPreferenceValue(sourceId, "preferred_language");
|
||||||
videos.sort((MVideo a, MVideo b) {
|
videos.sort((MVideo a, MVideo b) {
|
||||||
int qualityMatchA = 0;
|
int qualityMatchA = 0;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import '../../../../../model/source.dart';
|
import '../../../../../model/source.dart';
|
||||||
|
|
||||||
Source get aniwave => _aniwave;
|
Source get aniwave => _aniwave;
|
||||||
const _aniwaveVersion = "0.0.8";
|
const _aniwaveVersion = "0.0.85";
|
||||||
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