This commit is contained in:
hexated 2023-04-14 21:47:38 +07:00
parent 180b8e77ee
commit 1b9b9fae18
5 changed files with 8 additions and 9 deletions

View file

@ -1,5 +1,5 @@
// use an integer for version numbers
version = 23
version = 24
cloudstream {

View file

@ -24,13 +24,11 @@ class Loklok : MainAPI() {
TvType.Anime,
TvType.AsianDrama,
)
// no license found
// thanks to https://github.com/napthedev/filmhot for providing API
companion object {
private const val geoblockError = "Loklok is Geoblock, use vpn or give up"
private val api = base64DecodeAPI("dg==LnQ=b2s=a2w=bG8=aS4=YXA=ZS0=aWw=b2I=LW0=Z2E=Ly8=czo=dHA=aHQ=")
private val apiUrl = "$api/${base64Decode("Y21zL2FwcA==")}"
private val pcApiUrl = base64DecodeAPI("cGM=Yi8=d2U=cy8=Y20=di8=LnQ=b2s=a2w=bG8=aS4=YXA=ZS0=aWw=b2I=LW0=Z2E=Ly8=czo=dHA=aHQ=")
private val searchApi = base64Decode("aHR0cHM6Ly9sb2tsb2suY29t")
private const val mainImageUrl = "https://images.weserv.nl"
private val headers = mutableMapOf(
@ -233,7 +231,7 @@ class Loklok : MainAPI() {
RequestBodyTypes.JSON.toMediaTypeOrNull()
)
val json = app.get(
"$apiUrl/media/previewInfo?category=${res.category}&contentId=${res.id}&episodeId=${res.epId}&definition=${video.code}",
"$pcApiUrl/movieDrama/getPlayInfo?category=${res.category}&contentId=${res.id}&episodeId=${res.epId}&definition=${video.code}",
headers = headers,
).parsedSafe<PreviewResponse>()?.data
callback.invoke(
@ -241,7 +239,7 @@ class Loklok : MainAPI() {
this.name,
this.name,
json?.mediaUrl ?: return@apmap null,
"",
"https://loklok.com/",
getQuality(json.currentDefinition ?: ""),
isM3u8 = true,
)

View file

@ -1,5 +1,5 @@
// use an integer for version numbers
version = 116
version = 117
cloudstream {

View file

@ -678,7 +678,7 @@ object SoraExtractor : SoraStream() {
json.definitionList?.map { video ->
val media = app.get(
"${soraAPI}/media/previewInfo?category=${type}&contentId=${id}&episodeId=${json.id}&definition=${video.code}",
"$soraSecondAPI/movieDrama/getPlayInfo?category=${type}&contentId=${id}&episodeId=${json.id}&definition=${video.code}",
headers = soraHeaders,
).parsedSafe<SorastreamResponse>()?.data
@ -687,7 +687,7 @@ object SoraExtractor : SoraStream() {
this.name,
this.name,
media?.mediaUrl ?: return@map null,
"",
"https://loklok.com/",
getSoraQuality(media.currentDefinition ?: ""),
true,
)

View file

@ -41,6 +41,7 @@ import kotlin.collections.ArrayList
import kotlin.math.min
val soraAPI = base64DecodeAPI("cA==YXA=cy8=Y20=di8=LnQ=b2s=a2w=bG8=aS4=YXA=ZS0=aWw=b2I=LW0=Z2E=Ly8=czo=dHA=aHQ=")
val soraSecondAPI = base64DecodeAPI("cGM=Yi8=d2U=cy8=Y20=di8=LnQ=b2s=a2w=bG8=aS4=YXA=ZS0=aWw=b2I=LW0=Z2E=Ly8=czo=dHA=aHQ=")
val soraBackupAPI = base64DecodeAPI("dg==LnQ=bGw=aGk=dGM=dXM=Lmo=b2s=a2w=bG8=Ly8=czo=dHA=aHQ=")
val soraHeaders = mapOf(