mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
6f3a8c1cd2
* extractor: added Vidplay * fix id * fix Chillx * fix Linkbox * update m3u8helper in chillx * fix Dailymotion --------- Co-authored-by: Sofie99 <Sofie99@gmail.com>
55 lines
1.9 KiB
Kotlin
55 lines
1.9 KiB
Kotlin
package com.lagradost.cloudstream3.extractors
|
|
|
|
import com.fasterxml.jackson.annotation.JsonProperty
|
|
import com.lagradost.cloudstream3.SubtitleFile
|
|
import com.lagradost.cloudstream3.app
|
|
import com.lagradost.cloudstream3.utils.ExtractorApi
|
|
import com.lagradost.cloudstream3.utils.ExtractorLink
|
|
import com.lagradost.cloudstream3.utils.getQualityFromName
|
|
|
|
open class Linkbox : ExtractorApi() {
|
|
override val name = "Linkbox"
|
|
override val mainUrl = "https://www.linkbox.to"
|
|
override val requiresReferer = true
|
|
|
|
override suspend fun getUrl(
|
|
url: String,
|
|
referer: String?,
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
callback: (ExtractorLink) -> Unit
|
|
) {
|
|
val token = Regex("""(?:/f/|/file/|\?id=)(\w+)""").find(url)?.groupValues?.get(1)
|
|
val id = app.get("$mainUrl/api/file/share_out_list/?sortField=utime&sortAsc=0&pageNo=1&pageSize=50&shareToken=$token").parsedSafe<Responses>()?.data?.itemId
|
|
app.get("$mainUrl/api/file/detail?itemId=$id", referer = url)
|
|
.parsedSafe<Responses>()?.data?.itemInfo?.resolutionList?.map { link ->
|
|
callback.invoke(
|
|
ExtractorLink(
|
|
name,
|
|
name,
|
|
link.url ?: return@map null,
|
|
url,
|
|
getQualityFromName(link.resolution)
|
|
)
|
|
)
|
|
}
|
|
}
|
|
|
|
data class Resolutions(
|
|
@JsonProperty("url") val url: String? = null,
|
|
@JsonProperty("resolution") val resolution: String? = null,
|
|
)
|
|
|
|
data class ItemInfo(
|
|
@JsonProperty("resolutionList") val resolutionList: ArrayList<Resolutions>? = arrayListOf(),
|
|
)
|
|
|
|
data class Data(
|
|
@JsonProperty("itemInfo") val itemInfo: ItemInfo? = null,
|
|
@JsonProperty("itemId") val itemId: String? = null,
|
|
)
|
|
|
|
data class Responses(
|
|
@JsonProperty("data") val data: Data? = null,
|
|
)
|
|
|
|
} |