@ -5,7 +5,7 @@ ext {
|
||||
extName = '9anime'
|
||||
pkgNameSuffix = 'en.nineanime'
|
||||
extClass = '.NineAnime'
|
||||
extVersionCode = 26
|
||||
extVersionCode = 27
|
||||
libVersion = '13'
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,8 @@ import android.app.Application
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.webkit.JavascriptInterface
|
||||
import android.webkit.WebResourceRequest
|
||||
import android.webkit.WebResourceResponse
|
||||
import android.webkit.WebView
|
||||
import android.webkit.WebViewClient
|
||||
import eu.kanade.tachiyomi.network.GET
|
||||
@ -52,26 +54,26 @@ class JsInterceptor(private val lang: String) : Interceptor {
|
||||
// JavaSrcipt gets the Dub or Sub link of vidstream
|
||||
val jsScript = """
|
||||
(function(){
|
||||
window.onload = (function() {
|
||||
let el = document.querySelector('div[data-type="$lang"] ul li[data-sv-id="41"]');
|
||||
let e = document.createEvent('HTMLEvents');
|
||||
e.initEvent('click',true,true);
|
||||
el.dispatchEvent(e);
|
||||
setTimeout(function(){
|
||||
const resources = performance.getEntriesByType('resource');
|
||||
resources.forEach((entry) => {
|
||||
if(entry.name.includes("https://vidstream.pro/embed/")){
|
||||
window.android.passPayload(entry.name);
|
||||
let hoster = document.querySelector('div[data-type="$lang"] ul li[data-sv-id="41"]');
|
||||
let event = document.createEvent('HTMLEvents');
|
||||
event.initEvent('click',true,true);
|
||||
hoster.dispatchEvent(event);
|
||||
let intervalId = setInterval(() => {
|
||||
let element = document.querySelector("#player iframe");
|
||||
if (element) {
|
||||
clearInterval(intervalId);
|
||||
window.android.passPayload(element.src)
|
||||
}
|
||||
});
|
||||
}, 5000);
|
||||
}, 500);
|
||||
})();
|
||||
})();"""
|
||||
"""
|
||||
|
||||
val headers = request.headers.toMultimap().mapValues { it.value.getOrNull(0) ?: "" }.toMutableMap()
|
||||
|
||||
var newRequest: Request? = null
|
||||
|
||||
var head = ""
|
||||
|
||||
handler.post {
|
||||
val webview = WebView(context)
|
||||
webView = webview
|
||||
@ -84,6 +86,12 @@ class JsInterceptor(private val lang: String) : Interceptor {
|
||||
userAgentString = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0"
|
||||
webview.addJavascriptInterface(jsinterface, "android")
|
||||
webview.webViewClient = object : WebViewClient() {
|
||||
override fun shouldInterceptRequest(view: WebView?, request: WebResourceRequest?): WebResourceResponse? {
|
||||
if (request?.url.toString().contains("https://vidstream.pro/embed")) {
|
||||
head = request?.url.toString()
|
||||
}
|
||||
return super.shouldInterceptRequest(view, request)
|
||||
}
|
||||
override fun onPageFinished(view: WebView?, url: String?) {
|
||||
view?.evaluateJavascript(jsScript) {}
|
||||
}
|
||||
@ -99,7 +107,17 @@ class JsInterceptor(private val lang: String) : Interceptor {
|
||||
webView?.destroy()
|
||||
webView = null
|
||||
}
|
||||
newRequest = GET(request.url.toString(), headers = Headers.headersOf("url", jsinterface.payload))
|
||||
newRequest = GET(
|
||||
request.url.toString(),
|
||||
headers = Headers.headersOf(
|
||||
"url",
|
||||
if (jsinterface.payload.isNullOrEmpty() || (!jsinterface.payload.contains("https://vidstream.pro/embed"))) {
|
||||
head
|
||||
} else {
|
||||
jsinterface.payload
|
||||
}
|
||||
)
|
||||
)
|
||||
return newRequest
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,8 @@ import android.app.Application
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.webkit.JavascriptInterface
|
||||
import android.webkit.WebResourceRequest
|
||||
import android.webkit.WebResourceResponse
|
||||
import android.webkit.WebView
|
||||
import android.webkit.WebViewClient
|
||||
import eu.kanade.tachiyomi.network.GET
|
||||
@ -58,7 +60,7 @@ class JsVizInterceptor(private val embedLink: String) : Interceptor {
|
||||
|
||||
const originalOpen = iframe.contentWindow.XMLHttpRequest.prototype.open;
|
||||
iframe.contentWindow.XMLHttpRequest.prototype.open = function(method, url, async) {
|
||||
if (!url.includes("ping") && !url.includes("/assets/") && !url.includes("thumbnails") && !url.includes("jpg") && !url.includes("m3u8")) {
|
||||
if (!url.includes("ping") && !url.includes("/assets/") && !url.includes("thumbnails") && !url.includes("jpg") && !url.includes("m3u8") && !url.includes("simplewebanalysis")) {
|
||||
if (url == null) {
|
||||
const entries = iframe.contentWindow.performance.getEntries();
|
||||
entries.forEach((entry) => {
|
||||
@ -81,6 +83,8 @@ class JsVizInterceptor(private val embedLink: String) : Interceptor {
|
||||
|
||||
var newRequest: Request? = null
|
||||
|
||||
var head = ""
|
||||
|
||||
handler.post {
|
||||
val webview = WebView(context)
|
||||
webView = webview
|
||||
@ -93,6 +97,18 @@ class JsVizInterceptor(private val embedLink: String) : Interceptor {
|
||||
userAgentString = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0"
|
||||
webview.addJavascriptInterface(jsinterface, "android")
|
||||
webview.webViewClient = object : WebViewClient() {
|
||||
override fun shouldInterceptRequest(view: WebView?, request: WebResourceRequest?): WebResourceResponse? {
|
||||
if (request?.url.toString().contains("https://vidstream.pro/")) {
|
||||
if (request?.url.toString().contains("/embed/") || request?.url.toString().contains("/ping/") || request?.url.toString().contains("favicon.ico") ||
|
||||
request?.url.toString().contains("/assets/") || request?.url.toString().contains("/players/")
|
||||
) {
|
||||
return null
|
||||
} else {
|
||||
head = request?.url.toString()
|
||||
}
|
||||
}
|
||||
return super.shouldInterceptRequest(view, request)
|
||||
}
|
||||
override fun onPageFinished(view: WebView?, url: String?) {
|
||||
view?.evaluateJavascript(jsScript) {}
|
||||
}
|
||||
@ -108,7 +124,17 @@ class JsVizInterceptor(private val embedLink: String) : Interceptor {
|
||||
webView?.destroy()
|
||||
webView = null
|
||||
}
|
||||
newRequest = GET(request.url.toString(), headers = Headers.headersOf("url", jsinterface.payload))
|
||||
newRequest = GET(
|
||||
request.url.toString(),
|
||||
headers = Headers.headersOf(
|
||||
"url",
|
||||
if (jsinterface.payload.isNullOrEmpty() || (!jsinterface.payload.contains("https://vidstream.pro"))) {
|
||||
head
|
||||
} else {
|
||||
jsinterface.payload
|
||||
}
|
||||
)
|
||||
)
|
||||
return newRequest
|
||||
}
|
||||
}
|
||||
|
@ -58,7 +58,13 @@ class JsVrfInterceptor(private val query: String, private val baseUrl: String) :
|
||||
let e = document.createEvent('HTMLEvents');
|
||||
e.initEvent('keyup', true, true);
|
||||
inputElemente.dispatchEvent(e);
|
||||
window.android.passPayload(document.querySelector('form.filters input[type="hidden"]').value);
|
||||
let intervalId = setInterval(() => {
|
||||
let element = document.querySelector('form.filters input[type="hidden"]').value;
|
||||
if (element) {
|
||||
clearInterval(intervalId);
|
||||
window.android.passPayload(element)
|
||||
}
|
||||
}, 100);
|
||||
})();
|
||||
"""
|
||||
|
||||
|
Reference in New Issue
Block a user