mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
37 lines
1.1 KiB
Kotlin
37 lines
1.1 KiB
Kotlin
|
package com.lagradost.cloudstream3.extractors
|
||
|
|
||
|
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.Qualities
|
||
|
import com.lagradost.cloudstream3.utils.httpsify
|
||
|
|
||
|
open class Krakenfiles : ExtractorApi() {
|
||
|
override val name = "Krakenfiles"
|
||
|
override val mainUrl = "https://krakenfiles.com"
|
||
|
override val requiresReferer = false
|
||
|
|
||
|
override suspend fun getUrl(
|
||
|
url: String,
|
||
|
referer: String?,
|
||
|
subtitleCallback: (SubtitleFile) -> Unit,
|
||
|
callback: (ExtractorLink) -> Unit
|
||
|
) {
|
||
|
val id = Regex("/(?:view|embed-video)/([\\da-zA-Z]+)").find(url)?.groupValues?.get(1)
|
||
|
val doc = app.get("$mainUrl/embed-video/$id").document
|
||
|
val link = doc.selectFirst("source")?.attr("src")
|
||
|
|
||
|
callback.invoke(
|
||
|
ExtractorLink(
|
||
|
this.name,
|
||
|
this.name,
|
||
|
httpsify(link ?: return),
|
||
|
"",
|
||
|
Qualities.Unknown.value
|
||
|
)
|
||
|
)
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|