mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
fixed several providers
This commit is contained in:
parent
8fbd218574
commit
3f2f8d8000
8 changed files with 45 additions and 36 deletions
|
@ -25,12 +25,6 @@ class Loklok : MainAPI() {
|
|||
TvType.AsianDrama,
|
||||
)
|
||||
|
||||
private val headers = mutableMapOf(
|
||||
"lang" to "en",
|
||||
"versioncode" to "33",
|
||||
"clienttype" to "android_tem3",
|
||||
)
|
||||
|
||||
// no license found
|
||||
// thanks to https://github.com/napthedev/filmhot for providing API
|
||||
companion object {
|
||||
|
@ -38,6 +32,12 @@ class Loklok : MainAPI() {
|
|||
private val apiUrl = "$api/${base64Decode("Y21zL2FwcA==")}"
|
||||
private val searchApi = base64Decode("aHR0cHM6Ly9sb2tsb2suY29t")
|
||||
private const val mainImageUrl = "https://images.weserv.nl"
|
||||
private val headers = mutableMapOf(
|
||||
"lang" to "en",
|
||||
"versioncode" to "33",
|
||||
"clienttype" to "android_tem3",
|
||||
"deviceid" to getDeviceId()
|
||||
)
|
||||
|
||||
private fun base64DecodeAPI(api: String): String {
|
||||
return api.chunked(4).map { base64Decode(it) }.reversed().joinToString("")
|
||||
|
@ -132,8 +132,6 @@ class Loklok : MainAPI() {
|
|||
headers = headers
|
||||
).parsedSafe<Load>()?.data ?: throw ErrorLoadingException("Invalid Json Reponse")
|
||||
|
||||
headers["deviceid"] = getDevideId()
|
||||
|
||||
val actors = res.starList?.mapNotNull {
|
||||
Actor(
|
||||
it.localName ?: return@mapNotNull null, it.image
|
||||
|
@ -269,13 +267,6 @@ class Loklok : MainAPI() {
|
|||
}
|
||||
}
|
||||
|
||||
private fun getDevideId(length: Int = 16): String {
|
||||
val allowedChars = ('a'..'f') + ('0'..'9')
|
||||
return (1..length)
|
||||
.map { allowedChars.random() }
|
||||
.joinToString("")
|
||||
}
|
||||
|
||||
private suspend fun getTracker(title: String?, type: String?, year: Int?): Tracker {
|
||||
val res = app.get("https://api.consumet.org/meta/anilist/$title")
|
||||
.parsedSafe<AniSearch>()?.results?.find { media ->
|
||||
|
@ -428,3 +419,10 @@ class Loklok : MainAPI() {
|
|||
|
||||
}
|
||||
|
||||
fun getDeviceId(length: Int = 16): String {
|
||||
val allowedChars = ('a'..'f') + ('0'..'9')
|
||||
return (1..length)
|
||||
.map { allowedChars.random() }
|
||||
.joinToString("")
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue