Add files via upload

This commit is contained in:
almightyhak 2024-08-06 02:01:25 +07:00 committed by GitHub
parent 173699bd63
commit 0ad51bcdfd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -56,8 +56,7 @@ class VidsrcExtractor(private val client: OkHttpClient, private val headers: Hea
}
val vidId = embedLink.substringAfterLast("/").substringBefore("?")
val apiSlug = encodeID(vidId, ENCRYPTION_KEY1)
val h1 = encodeID(vidId, ENCRYPTION_KEY2)
val h2 = encodeID(vidId, ENCRYPTION_KEY3)
val h = encodeID(vidId, ENCRYPTION_KEY2)
return buildString {
append("https://")
@ -100,26 +99,19 @@ class VidsrcExtractor(private val client: OkHttpClient, private val headers: Hea
}
}
private fun vrfDecrypt(input: String, useKey2: Boolean): String {
var vrf = Base64.decode(input.toByteArray(), Base64.URL_SAFE)
val rc4Key = if (useKey2) {
SecretKeySpec(DECRYPTION_KEY2.toByteArray(), "RC4")
} else {
SecretKeySpec(DECRYPTION_KEY.toByteArray(), "RC4")
}
val cipher = Cipher.getInstance("RC4")
cipher.init(Cipher.DECRYPT_MODE, rc4Key, cipher.parameters)
vrf = cipher.doFinal(vrf)
return URLDecoder.decode(vrf.toString(Charsets.UTF_8), "utf-8")
private fun vrfDecrypt(input: String): String {
var vrf = Base64.decode(input.toByteArray(), Base64.URL_SAFE)
val rc4Key = SecretKeySpec(DECRYPTION_KEY.toByteArray(), "RC4")
val cipher = Cipher.getInstance("RC4")
cipher.init(Cipher.DECRYPT_MODE, rc4Key, cipher.parameters)
vrf = cipher.doFinal(vrf)
return URLDecoder.decode(vrf.toString(Charsets.UTF_8), "utf-8")
}
companion object {
private const val ENCRYPTION_KEY1 = "bZSQ97kGOREZeGik"
private const val ENCRYPTION_KEY2 = "NeBk5CElH19ucfBU"
private const val ENCRYPTION_KEY3 = "Z7YMUOoLEjfNqPAt"
private const val DECRYPTION_KEY = "wnRQe3OZ1vMcD1ML"
private const val DECRYPTION_KEY1 = "eO74cTKZayUWH8x5"
}
private const val ENCRYPTION_KEY1 = "8Qy3mlM2kod80XIK"
private const val ENCRYPTION_KEY2 = "BgKVSrzpH2Enosgm"
private const val DECRYPTION_KEY = "9jXDYBZUcTcTZveM"
}
}