shahid4u update
This commit is contained in:
parent
1bdcc22d7f
commit
dfac8a1ac9
4 changed files with 72 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
version = 3
|
||||
version = 4
|
||||
|
||||
cloudstream {
|
||||
description = ""
|
||||
|
|
|
@ -0,0 +1,67 @@
|
|||
package com.shahid4u
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty
|
||||
import com.lagradost.cloudstream3.app
|
||||
import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson
|
||||
import com.lagradost.cloudstream3.utils.ExtractorApi
|
||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||
import com.lagradost.cloudstream3.utils.getQualityFromName
|
||||
|
||||
open class JWPlayer : ExtractorApi() {
|
||||
override val name = "JWPlayer"
|
||||
override val mainUrl = "https://www.jwplayer.com"
|
||||
override val requiresReferer = false
|
||||
|
||||
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink>? {
|
||||
val sources = mutableListOf<ExtractorLink>()
|
||||
with(app.get(url).document) {
|
||||
val data = this.select("script").mapNotNull { script ->
|
||||
if (script.data().contains("sources: [")) {
|
||||
script.data().substringAfter("sources: [")
|
||||
.substringBefore("],").replace("'", "\"")
|
||||
} else if (script.data().contains("otakudesu('")) {
|
||||
script.data().substringAfter("otakudesu('")
|
||||
.substringBefore("');")
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
tryParseJson<List<ResponseSource>>("$data")?.map {
|
||||
sources.add(
|
||||
ExtractorLink(
|
||||
name,
|
||||
name,
|
||||
it.file,
|
||||
referer = url,
|
||||
quality = getQualityFromName(
|
||||
Regex("(\\d{3,4}p)").find(it.file)?.groupValues?.get(
|
||||
1
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
return sources
|
||||
}
|
||||
|
||||
private data class ResponseSource(
|
||||
@JsonProperty("file") val file: String,
|
||||
@JsonProperty("type") val type: String?,
|
||||
@JsonProperty("label") val label: String?
|
||||
)
|
||||
|
||||
}
|
||||
class VidHD : JWPlayer() {
|
||||
override val name = "VidHD"
|
||||
override val mainUrl = "https://vidhd.fun"
|
||||
}
|
||||
class GoStream : JWPlayer() {
|
||||
override val name = "GoStream"
|
||||
override val mainUrl = "https://gostream.pro"
|
||||
}
|
||||
class Vidbom : JWPlayer() {
|
||||
override val name = "Vidbom"
|
||||
override val mainUrl = "https://vidbom.com"
|
||||
}
|
|
@ -7,5 +7,8 @@ import android.content.Context
|
|||
class Shahid4uPlugin: Plugin() {
|
||||
override fun load(context: Context) {
|
||||
registerMainAPI(Shahid4u())
|
||||
registerExtractorAPI(VidHD())
|
||||
registerExtractorAPI(GoStream())
|
||||
registerExtractorAPI(Vidbom())
|
||||
}
|
||||
}
|
|
@ -161,7 +161,7 @@ class Shahid4u : MainAPI() {
|
|||
): Boolean {
|
||||
val watchUrl = "$data/watch"
|
||||
app.get(watchUrl).document.select(
|
||||
".servers-list li:contains(ok), li:contains(Streamtape), li:contains(DoodStream), li:contains(Uqload), li:contains(Voe), li:contains(VIDBOM), li:contains(Upstream)"
|
||||
".servers-list li:contains(ok), li:contains(Streamtape), li:contains(DoodStream), li:contains(Uqload), li:contains(Voe), li:contains(VIDBOM), li:contains(Upstream), li:contains(السيرفر الخاص), li:contains(GoStream), li:contains(الخاص 1080p), li:contains(vidbom), li:contains(Vidbom)"
|
||||
).apmap {
|
||||
val id = it.attr("data-id")
|
||||
val i = it.attr("data-i")
|
||||
|
|
Loading…
Reference in a new issue