updated gogoanime key + added userscript to get keys

This commit is contained in:
Blatzar 2022-04-16 16:17:20 +02:00
parent 478b7a0066
commit d5bae8376c
4 changed files with 59 additions and 10 deletions

View file

@ -61,20 +61,22 @@ class GogoanimeProvider : MainAPI() {
* @param mainApiName used for ExtractorLink names and source * @param mainApiName used for ExtractorLink names and source
* @param iv secret iv from site, required non-null * @param iv secret iv from site, required non-null
* @param secretKey secret key for decryption from site, required non-null * @param secretKey secret key for decryption from site, required non-null
* @param secretDecryptKey secret key to decrypt the response json, required non-null
* */ * */
suspend fun extractVidstream( suspend fun extractVidstream(
iframeUrl: String, iframeUrl: String,
mainApiName: String, mainApiName: String,
callback: (ExtractorLink) -> Unit, callback: (ExtractorLink) -> Unit,
iv: ByteArray?, iv: ByteArray?,
secretKey: ByteArray? secretKey: ByteArray?,
secretDecryptKey: ByteArray?
) = safeApiCall { ) = safeApiCall {
// https://github.com/saikou-app/saikou/blob/3e756bd8e876ad7a9318b17110526880525a5cd3/app/src/main/java/ani/saikou/anime/source/extractors/GogoCDN.kt // https://github.com/saikou-app/saikou/blob/3e756bd8e876ad7a9318b17110526880525a5cd3/app/src/main/java/ani/saikou/anime/source/extractors/GogoCDN.kt
// No Licence on the following code // No Licence on the following code
// Also modified of https://github.com/jmir1/aniyomi-extensions/blob/master/src/en/gogoanime/src/eu/kanade/tachiyomi/animeextension/en/gogoanime/extractors/GogoCdnExtractor.kt // Also modified of https://github.com/jmir1/aniyomi-extensions/blob/master/src/en/gogoanime/src/eu/kanade/tachiyomi/animeextension/en/gogoanime/extractors/GogoCdnExtractor.kt
// License on the code above https://github.com/jmir1/aniyomi-extensions/blob/master/LICENSE // License on the code above https://github.com/jmir1/aniyomi-extensions/blob/master/LICENSE
if (iv == null || secretKey == null) if (iv == null || secretKey == null || secretDecryptKey == null)
return@safeApiCall return@safeApiCall
val uri = URI(iframeUrl) val uri = URI(iframeUrl)
@ -84,12 +86,12 @@ class GogoanimeProvider : MainAPI() {
val encryptedId = cryptoHandler(id, iv, secretKey) val encryptedId = cryptoHandler(id, iv, secretKey)
val jsonResponse = val jsonResponse =
app.get( app.get(
"$mainUrl/encrypt-ajax.php?id=$encryptedId", "$mainUrl/encrypt-ajax.php?id=$encryptedId&alias=$id",
headers = mapOf("X-Requested-With" to "XMLHttpRequest") headers = mapOf("X-Requested-With" to "XMLHttpRequest")
) )
val dataencrypted = val dataencrypted =
jsonResponse.text.substringAfter("{\"data\":\"").substringBefore("\"}") jsonResponse.text.substringAfter("{\"data\":\"").substringBefore("\"}")
val datadecrypted = cryptoHandler(dataencrypted, iv, secretKey, false) val datadecrypted = cryptoHandler(dataencrypted, iv, secretDecryptKey, false)
val sources = AppUtils.parseJson<GogoSources>(datadecrypted) val sources = AppUtils.parseJson<GogoSources>(datadecrypted)
fun invokeGogoSource( fun invokeGogoSource(
@ -370,10 +372,12 @@ class GogoanimeProvider : MainAPI() {
loadExtractor(data, streamingResponse.url, callback) loadExtractor(data, streamingResponse.url, callback)
} }
}, { }, {
val iv = "4786443969418267".toByteArray() val iv = "8244002440089157".toByteArray()
val secretKey = val secretKey =
"63976882873536819639922083275907".toByteArray() "93106165734640459728346589106791".toByteArray()
extractVidstream(iframe, this.name, callback, iv, secretKey) val secretDecryptKey =
"97952160493714852094564712118349".toByteArray()
extractVidstream(iframe, this.name, callback, iv, secretKey, secretDecryptKey)
}) })
} }
) )

View file

@ -199,7 +199,7 @@ class DramaSeeProvider : MainAPI() {
url.startsWith("https://asianembed.io") || url.startsWith("https://asianload.io") -> { url.startsWith("https://asianembed.io") || url.startsWith("https://asianload.io") -> {
val iv = "9262859232435825".toByteArray() val iv = "9262859232435825".toByteArray()
val secretKey = "93422192433952489752342908585752".toByteArray() val secretKey = "93422192433952489752342908585752".toByteArray()
extractVidstream(url, this.name, callback, iv, secretKey) extractVidstream(url, this.name, callback, iv, secretKey, secretKey)
AsianEmbedHelper.getUrls(url, callback) AsianEmbedHelper.getUrls(url, callback)
} }
url.startsWith("https://embedsito.com") -> { url.startsWith("https://embedsito.com") -> {

View file

@ -20,8 +20,53 @@ open class VidstreamProviderTemplate : MainAPI() {
* Try keys from other providers before cracking * Try keys from other providers before cracking
* one yourself. * one yourself.
* */ * */
// Userscript to get the keys:
/*
// ==UserScript==
// @name Easy keys
// @namespace Violentmonkey Scripts
// @match https://*/streaming.php*
// @grant none
// @version 1.0
// @author LagradOst
// @description 4/16/2022, 2:05:31 PM
// ==/UserScript==
let encrypt = CryptoJS.AES.encrypt;
CryptoJS.AES.encrypt = (message, key, cfg) => {
let realKey = CryptoJS.enc.Utf8.stringify(key);
let realIv = CryptoJS.enc.Utf8.stringify(cfg.iv);
var result = encrypt(message, key, cfg);
let realResult = CryptoJS.enc.Utf8.stringify(result);
popup = "Encrypt key: " + realKey + "\n\nIV: " + realIv + "\n\nMessage: " + message + "\n\nResult: " + realResult;
alert(popup);
return result;
};
let decrypt = CryptoJS.AES.decrypt;
CryptoJS.AES.decrypt = (message, key, cfg) => {
let realKey = CryptoJS.enc.Utf8.stringify(key);
let realIv = CryptoJS.enc.Utf8.stringify(cfg.iv);
let result = decrypt(message, key, cfg);
let realResult = CryptoJS.enc.Utf8.stringify(result);
popup = "Decrypt key: " + realKey + "\n\nIV: " + realIv + "\n\nMessage: " + message + "\n\nResult: " + realResult;
alert(popup);
return result;
};
*/
*/
open val iv: ByteArray? = null open val iv: ByteArray? = null
open val secretKey: ByteArray? = null open val secretKey: ByteArray? = null
open val secretDecryptKey: ByteArray? = null
// // mainUrl is good to have as a holder for the url to make future changes easier. // // mainUrl is good to have as a holder for the url to make future changes easier.
// override val mainUrl: String // override val mainUrl: String
@ -207,7 +252,7 @@ open class VidstreamProviderTemplate : MainAPI() {
val iframeLink = val iframeLink =
Jsoup.parse(app.get(data).text).selectFirst("iframe")?.attr("src") ?: return false Jsoup.parse(app.get(data).text).selectFirst("iframe")?.attr("src") ?: return false
extractVidstream(iframeLink, this.name, callback, iv, secretKey) extractVidstream(iframeLink, this.name, callback, iv, secretKey, secretDecryptKey)
// In this case the video player is a vidstream clone and can be handled by the vidstream extractor. // In this case the video player is a vidstream clone and can be handled by the vidstream extractor.
// This case is a both unorthodox and you normally do not call extractors as they detect the url returned and does the rest. // This case is a both unorthodox and you normally do not call extractors as they detect the url returned and does the rest.
val vidstreamObject = Vidstream(vidstreamExtractorUrl ?: mainUrl) val vidstreamObject = Vidstream(vidstreamExtractorUrl ?: mainUrl)

View file

@ -216,7 +216,7 @@ class WatchAsianProvider : MainAPI() {
url.startsWith("https://asianembed.io") || url.startsWith("https://asianload.io") -> { url.startsWith("https://asianembed.io") || url.startsWith("https://asianload.io") -> {
val iv = "9262859232435825".toByteArray() val iv = "9262859232435825".toByteArray()
val secretKey = "93422192433952489752342908585752".toByteArray() val secretKey = "93422192433952489752342908585752".toByteArray()
extractVidstream(url, this.name, callback, iv, secretKey) extractVidstream(url, this.name, callback, iv, secretKey, secretKey)
AsianEmbedHelper.getUrls(url, callback) AsianEmbedHelper.getUrls(url, callback)
} }
url.startsWith("https://embedsito.com") -> { url.startsWith("https://embedsito.com") -> {