mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
fix: pr requested changes
This commit is contained in:
parent
833bbf5dab
commit
6a7db60998
1 changed files with 4 additions and 6 deletions
|
@ -14,9 +14,8 @@ class JsHunter(private val hunterJS: String) {
|
||||||
* @return true if it's H.U.N.T.E.R coded.
|
* @return true if it's H.U.N.T.E.R coded.
|
||||||
*/
|
*/
|
||||||
fun detect(): Boolean {
|
fun detect(): Boolean {
|
||||||
val js = hunterJS
|
|
||||||
val p = Pattern.compile("eval\\(function\\(h,u,n,t,e,r\\)")
|
val p = Pattern.compile("eval\\(function\\(h,u,n,t,e,r\\)")
|
||||||
val searchResults = p.matcher(js)
|
val searchResults = p.matcher(hunterJS)
|
||||||
return searchResults.find()
|
return searchResults.find()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,15 +25,14 @@ class JsHunter(private val hunterJS: String) {
|
||||||
* @return the javascript unhunt or null.
|
* @return the javascript unhunt or null.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
fun dehunt(): String {
|
fun dehunt(): String? {
|
||||||
val js = hunterJS
|
|
||||||
try {
|
try {
|
||||||
val p: Pattern =
|
val p: Pattern =
|
||||||
Pattern.compile(
|
Pattern.compile(
|
||||||
"""}\("([^"]+)",[^,]+,\s*"([^"]+)",\s*(\d+),\s*(\d+)""",
|
"""}\("([^"]+)",[^,]+,\s*"([^"]+)",\s*(\d+),\s*(\d+)""",
|
||||||
Pattern.DOTALL
|
Pattern.DOTALL
|
||||||
)
|
)
|
||||||
val searchResults: Matcher = p.matcher(js)
|
val searchResults: Matcher = p.matcher(hunterJS)
|
||||||
if (searchResults.find() && searchResults.groupCount() == 4) {
|
if (searchResults.find() && searchResults.groupCount() == 4) {
|
||||||
val h = searchResults.group(1)!!.toString()
|
val h = searchResults.group(1)!!.toString()
|
||||||
val n = searchResults.group(2)!!.toString()
|
val n = searchResults.group(2)!!.toString()
|
||||||
|
@ -45,7 +43,7 @@ class JsHunter(private val hunterJS: String) {
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
logError(e)
|
logError(e)
|
||||||
}
|
}
|
||||||
return ""
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun duf(d: String, e: Int, f: Int = 10): Int {
|
private fun duf(d: String, e: Int, f: Int = 10): Int {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue