mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
fixed Linkbox (#390)
This commit is contained in:
parent
aeab423d29
commit
f722785a37
1 changed files with 21 additions and 16 deletions
|
@ -18,31 +18,36 @@ open class Linkbox : ExtractorApi() {
|
||||||
subtitleCallback: (SubtitleFile) -> Unit,
|
subtitleCallback: (SubtitleFile) -> Unit,
|
||||||
callback: (ExtractorLink) -> Unit
|
callback: (ExtractorLink) -> Unit
|
||||||
) {
|
) {
|
||||||
val id = Regex("""(/file/|id=)(\S+)[&/?]""").find(url)?.groupValues?.get(2)
|
val id = Regex("""(?:/f/|/file/|\?id=)(\w+)""").find(url)?.groupValues?.get(1)
|
||||||
app.get("$mainUrl/api/open/get_url?itemId=$id", referer=url).parsedSafe<Responses>()?.data?.rList?.map { link ->
|
app.get("$mainUrl/api/file/detail?itemId=$id", referer = url)
|
||||||
callback.invoke(
|
.parsedSafe<Responses>()?.data?.itemInfo?.resolutionList?.map { link ->
|
||||||
ExtractorLink(
|
callback.invoke(
|
||||||
name,
|
ExtractorLink(
|
||||||
name,
|
name,
|
||||||
link.url,
|
name,
|
||||||
url,
|
link.url ?: return@map null,
|
||||||
getQualityFromName(link.resolution)
|
url,
|
||||||
|
getQualityFromName(link.resolution)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
data class RList(
|
data class Resolutions(
|
||||||
@JsonProperty("url") val url: String,
|
@JsonProperty("url") val url: String? = null,
|
||||||
@JsonProperty("resolution") val resolution: String?,
|
@JsonProperty("resolution") val resolution: String? = null,
|
||||||
|
)
|
||||||
|
|
||||||
|
data class ItemInfo(
|
||||||
|
@JsonProperty("resolutionList") val resolutionList: ArrayList<Resolutions>? = arrayListOf(),
|
||||||
)
|
)
|
||||||
|
|
||||||
data class Data(
|
data class Data(
|
||||||
@JsonProperty("rList") val rList: List<RList>?,
|
@JsonProperty("itemInfo") val itemInfo: ItemInfo? = null,
|
||||||
)
|
)
|
||||||
|
|
||||||
data class Responses(
|
data class Responses(
|
||||||
@JsonProperty("data") val data: Data?,
|
@JsonProperty("data") val data: Data? = null,
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in a new issue