mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
fix #245
This commit is contained in:
parent
1affe156b1
commit
471a1703a3
14 changed files with 73 additions and 236 deletions
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 21
|
||||
version = 22
|
||||
|
||||
|
||||
cloudstream {
|
||||
|
|
45
OploverzProvider/src/main/kotlin/com/hexated/Extractors.kt
Normal file
45
OploverzProvider/src/main/kotlin/com/hexated/Extractors.kt
Normal file
|
@ -0,0 +1,45 @@
|
|||
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(
|
||||
"Accept" to "video/webm,video/ogg,video/*;q=0.9,application/ogg;q=0.7,audio/*;q=0.6,*/*;q=0.5",
|
||||
"Range" to "bytes=0-",
|
||||
"Sec-Fetch-Dest" to "video",
|
||||
"Sec-Fetch-Mode" to "no-cors",
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
private fun getIndexQuality(str: String): Int {
|
||||
return Regex("(\\d{3,4})[pP]").find(str)?.groupValues?.getOrNull(1)?.toIntOrNull()
|
||||
?: Qualities.Unknown.value
|
||||
}
|
||||
|
||||
}
|
|
@ -6,7 +6,7 @@ import com.lagradost.cloudstream3.utils.*
|
|||
import org.jsoup.nodes.Element
|
||||
|
||||
class OploverzProvider : MainAPI() {
|
||||
override var mainUrl = "https://oploverz.team"
|
||||
override var mainUrl = "https://oploverz.red"
|
||||
override var name = "Oploverz"
|
||||
override val hasMainPage = true
|
||||
override var lang = "id"
|
||||
|
|
|
@ -10,5 +10,6 @@ class OploverzProviderPlugin: Plugin() {
|
|||
override fun load(context: Context) {
|
||||
// All providers should be added in this manner. Please don't edit the providers list directly.
|
||||
registerMainAPI(OploverzProvider())
|
||||
registerExtractorAPI(Qiwi())
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue