This commit is contained in:
hexated 2023-02-21 22:50:13 +07:00
parent 03e8ade0e0
commit 7a5a2375c7
5 changed files with 13 additions and 7 deletions

View File

@ -1,12 +1,13 @@
// use an integer for version numbers // use an integer for version numbers
version = 16 version = 17
cloudstream { cloudstream {
language = "en" language = "en"
// All of these properties are optional, you can safely remove them // All of these properties are optional, you can safely remove them
description = "#2 best extension based on Loklok API" // description = "#2 best extension based on Loklok API"
description = "Use External Player"
authors = listOf("Hexated") authors = listOf("Hexated")
/** /**

View File

@ -223,9 +223,10 @@ class Loklok : MainAPI() {
"""[{"category":${res.category},"contentId":"${res.id}","episodeId":${res.epId},"definition":"${video.code}"}]""".toRequestBody( """[{"category":${res.category},"contentId":"${res.id}","episodeId":${res.epId},"definition":"${video.code}"}]""".toRequestBody(
RequestBodyTypes.JSON.toMediaTypeOrNull() RequestBodyTypes.JSON.toMediaTypeOrNull()
) )
val json = val json = app.get(
app.post("$apiUrl/media/bathGetplayInfo", requestBody = body, headers = headers) "$apiUrl/media/previewInfo?category=${res.category}&contentId=${res.id}&episodeId=${res.epId}&definition=${video.code}",
.parsedSafe<PreviewResponse>()?.data?.firstOrNull() headers = headers,
).parsedSafe<PreviewResponse>()?.data
callback.invoke( callback.invoke(
ExtractorLink( ExtractorLink(
this.name, this.name,
@ -337,7 +338,7 @@ class Loklok : MainAPI() {
) )
data class PreviewResponse( data class PreviewResponse(
@JsonProperty("data") val data: ArrayList<PreviewVideos>? = arrayListOf(), @JsonProperty("data") val data: PreviewVideos? = null,
) )
data class PreviewVideos( data class PreviewVideos(

View File

@ -847,6 +847,7 @@ object SoraExtractor : SoraStream() {
year: Int? = null, year: Int? = null,
season: Int? = null, season: Int? = null,
episode: Int? = null, episode: Int? = null,
lastSeason: Int? = null,
subtitleCallback: (SubtitleFile) -> Unit, subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit callback: (ExtractorLink) -> Unit
) { ) {
@ -858,7 +859,7 @@ object SoraExtractor : SoraStream() {
"$fixTitle", true "$fixTitle", true
) == true && it.releaseDate?.equals("$year") == true && it.type == "Movie" ) == true && it.releaseDate?.equals("$year") == true && it.type == "Movie"
} else { } else {
it.title?.equals("$fixTitle", true) == true && it.type == "TV Series" it.title?.equals("$fixTitle", true) == true && it.type == "TV Series" && it.season == lastSeason
} }
}?.id ?: return }?.id ?: return
@ -2780,6 +2781,7 @@ data class CrunchyrollDetails(
data class ConsumetResults( data class ConsumetResults(
@JsonProperty("id") val id: String? = null, @JsonProperty("id") val id: String? = null,
@JsonProperty("title") val title: String? = null, @JsonProperty("title") val title: String? = null,
@JsonProperty("season") val season: Int? = null,
@JsonProperty("releaseDate") val releaseDate: String? = null, @JsonProperty("releaseDate") val releaseDate: String? = null,
@JsonProperty("type") val type: String? = null, @JsonProperty("type") val type: String? = null,
) )

View File

@ -471,6 +471,7 @@ open class SoraStream : TmdbProvider() {
res.year, res.year,
res.season, res.season,
res.episode, res.episode,
res.lastSeason,
subtitleCallback, subtitleCallback,
callback callback
) )

View File

@ -172,6 +172,7 @@ class SoraStreamLite : SoraStream() {
res.year, res.year,
res.season, res.season,
res.episode, res.episode,
res.lastSeason,
subtitleCallback, subtitleCallback,
callback callback
) )