Update ReCapBypass to v1.1 (#1585)

Prevents 404 status loop & small changes
add to aniworld & serienstream
This commit is contained in:
LuftVerbot 2023-05-08 13:57:58 +02:00 committed by GitHub
parent 20fef93b24
commit 5d5ba1fafc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 110 additions and 88 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'AniWorld (experimental)'
pkgNameSuffix = 'de.aniworld'
extClass = '.AniWorld'
extVersionCode = 13
extVersionCode = 14
libVersion = '13'
}

View File

@ -238,9 +238,9 @@ class JsInterceptor : Interceptor {
return result.text;
}
(async function() {
async function main() {
let intervalIdA = setInterval(() => {
let iframewindow = document.querySelector('iframe[title="reCAPTCHA-Aufgabe läuft in zwei Minuten ab"]').contentWindow;
let iframewindow = document.querySelector("iframe[src*='recaptcha/api2']:not([src*=anchor])").contentWindow;
if (iframewindow) {
clearInterval(intervalIdA);
let audiobutton = iframewindow.document.querySelector('#recaptcha-audio-button');
@ -248,9 +248,13 @@ class JsInterceptor : Interceptor {
event.initEvent('click', false, false);
audiobutton.dispatchEvent(event);
let intervalIdB = setInterval(async () => {
let source = iframewindow.document.querySelector('#audio-source').getAttribute('src');
let audio = iframewindow.document.querySelector('#audio-source');
let source = audio.getAttribute('src');
if (source) {
clearInterval(intervalIdB);
// Prevent 404 status loop
const response = await fetch(source);
if (response.ok) {
let audioresponse = iframewindow.document.querySelector('#audio-response');
let verifybutton = iframewindow.document.querySelector('#recaptcha-verify-button');
var tries = 0;
@ -274,15 +278,22 @@ class JsInterceptor : Interceptor {
};
}
};
} else if(tries >= 2) {
} else if (tries >= 2) {
clearInterval(intervalIdC);
window.android.passPayload("");
}
}, 2000);
} else {
window.android.passPayload("Audio file not found");
}
}
}, 2000);
}
}, 2000);
})()
};
// Prevent async-related problems with stupid webviews
setTimeout(async () => await main(), 0);
"""
val headers = request.headers.toMultimap().mapValues { it.value.getOrNull(0) ?: "" }.toMutableMap()

View File

@ -6,7 +6,7 @@ ext {
extName = 'Serienstream'
pkgNameSuffix = 'de.serienstream'
extClass = '.Serienstream'
extVersionCode = 7
extVersionCode = 8
libVersion = '13'
}

View File

@ -238,9 +238,9 @@ class JsInterceptor : Interceptor {
return result.text;
}
(async function() {
async function main() {
let intervalIdA = setInterval(() => {
let iframewindow = document.querySelector('iframe[title="reCAPTCHA-Aufgabe läuft in zwei Minuten ab"]').contentWindow;
let iframewindow = document.querySelector("iframe[src*='recaptcha/api2']:not([src*=anchor])").contentWindow;
if (iframewindow) {
clearInterval(intervalIdA);
let audiobutton = iframewindow.document.querySelector('#recaptcha-audio-button');
@ -248,9 +248,13 @@ class JsInterceptor : Interceptor {
event.initEvent('click', false, false);
audiobutton.dispatchEvent(event);
let intervalIdB = setInterval(async () => {
let source = iframewindow.document.querySelector('#audio-source').getAttribute('src');
let audio = iframewindow.document.querySelector('#audio-source');
let source = audio.getAttribute('src');
if (source) {
clearInterval(intervalIdB);
// Prevent 404 status loop
const response = await fetch(source);
if (response.ok) {
let audioresponse = iframewindow.document.querySelector('#audio-response');
let verifybutton = iframewindow.document.querySelector('#recaptcha-verify-button');
var tries = 0;
@ -274,15 +278,22 @@ class JsInterceptor : Interceptor {
};
}
};
} else if(tries >= 2) {
} else if (tries >= 2) {
clearInterval(intervalIdC);
window.android.passPayload("");
}
}, 2000);
} else {
window.android.passPayload("Audio file not found");
}
}
}, 2000);
}
}, 2000);
})()
};
// Prevent async-related problems with stupid webviews
setTimeout(async () => await main(), 0);
"""
val headers = request.headers.toMultimap().mapValues { it.value.getOrNull(0) ?: "" }.toMutableMap()