42 lines
1.1 KiB
Kotlin
42 lines
1.1 KiB
Kotlin
package com.hexated
|
|
|
|
import com.lagradost.cloudstream3.SubtitleFile
|
|
import com.lagradost.cloudstream3.*
|
|
import com.lagradost.cloudstream3.utils.*
|
|
|
|
open class Qiwi : ExtractorApi() {
|
|
override val name = "Qiwi"
|
|
override val mainUrl = "https://qiwi.gg"
|
|
override val requiresReferer = true
|
|
|
|
override suspend fun getUrl(
|
|
url: String,
|
|
referer: String?,
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
callback: (ExtractorLink) -> Unit
|
|
) {
|
|
val document = app.get(url, referer = referer).document
|
|
val title = document.select("title").text()
|
|
val source = document.select("video source").attr("src")
|
|
|
|
callback.invoke(
|
|
ExtractorLink(
|
|
this.name,
|
|
this.name,
|
|
source,
|
|
"$mainUrl/",
|
|
getIndexQuality(title),
|
|
headers = mapOf(
|
|
"Range" to "bytes=0-",
|
|
)
|
|
)
|
|
)
|
|
|
|
}
|
|
|
|
private fun getIndexQuality(str: String): Int {
|
|
return Regex("(\\d{3,4})[pP]").find(str)?.groupValues?.getOrNull(1)?.toIntOrNull()
|
|
?: Qualities.Unknown.value
|
|
}
|
|
|
|
} |