Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
almightyhak authored Aug 5, 2024
1 parent 173699b commit 0ad51bc
Showing 1 changed file with 11 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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://")
Expand Down Expand Up @@ -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"
}
}

Expand Down

0 comments on commit 0ad51bc

Please sign in to comment.