mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
fixed #319
This commit is contained in:
parent
f543a6e523
commit
730dea79a2
8 changed files with 80 additions and 18 deletions
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 9
|
||||
version = 10
|
||||
|
||||
|
||||
cloudstream {
|
||||
|
|
|
@ -203,8 +203,3 @@ open class DramaidProvider : MainAPI() {
|
|||
|
||||
}
|
||||
|
||||
class Vanfem : XStreamCdn() {
|
||||
override val name: String = "Vanfem"
|
||||
override val mainUrl: String = "https://vanfem.com"
|
||||
}
|
||||
|
||||
|
|
|
@ -13,5 +13,6 @@ class DramaidProviderPlugin: Plugin() {
|
|||
registerMainAPI(Oppadrama())
|
||||
registerExtractorAPI(Vanfem())
|
||||
registerExtractorAPI(Filelions())
|
||||
registerExtractorAPI(Gcam())
|
||||
}
|
||||
}
|
71
DramaidProvider/src/main/kotlin/com/hexated/Extractors.kt
Normal file
71
DramaidProvider/src/main/kotlin/com/hexated/Extractors.kt
Normal file
|
@ -0,0 +1,71 @@
|
|||
package com.hexated
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty
|
||||
import com.lagradost.cloudstream3.APIHolder
|
||||
import com.lagradost.cloudstream3.SubtitleFile
|
||||
import com.lagradost.cloudstream3.app
|
||||
import com.lagradost.cloudstream3.extractors.Filesim
|
||||
import com.lagradost.cloudstream3.extractors.XStreamCdn
|
||||
import com.lagradost.cloudstream3.utils.ExtractorApi
|
||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||
import com.lagradost.cloudstream3.utils.M3u8Helper
|
||||
|
||||
open class Gcam : ExtractorApi() {
|
||||
override val name = "Gcam"
|
||||
override val mainUrl = "https://gdrive.cam"
|
||||
override val requiresReferer = true
|
||||
|
||||
override suspend fun getUrl(
|
||||
url: String,
|
||||
referer: String?,
|
||||
subtitleCallback: (SubtitleFile) -> Unit,
|
||||
callback: (ExtractorLink) -> Unit
|
||||
) {
|
||||
val response = app.get(url, referer = referer).text
|
||||
val kaken = "kaken\\s*=\\s*\"(.*)\"".toRegex().find(response)?.groupValues?.get(1)
|
||||
val json = app.get("https://cdn2.gdrive.cam/api/?${kaken ?: return}=&_=${APIHolder.unixTimeMS}").parsedSafe<Response>()
|
||||
|
||||
json?.sources?.map {
|
||||
M3u8Helper.generateM3u8(
|
||||
name,
|
||||
it.file ?: return@map,
|
||||
""
|
||||
).forEach(callback)
|
||||
}
|
||||
|
||||
json?.tracks?.map {
|
||||
subtitleCallback.invoke(
|
||||
SubtitleFile(
|
||||
it.label ?: return@map,
|
||||
it.file ?: return@map
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
data class Tracks(
|
||||
@JsonProperty("file") val file: String? = null,
|
||||
@JsonProperty("label") val label: String? = null,
|
||||
)
|
||||
|
||||
data class Sources(
|
||||
@JsonProperty("file") val file: String? = null,
|
||||
)
|
||||
|
||||
data class Response(
|
||||
@JsonProperty("sources") val sources: ArrayList<Sources>? = arrayListOf(),
|
||||
@JsonProperty("tracks") val tracks: ArrayList<Tracks>? = arrayListOf(),
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
class Vanfem : XStreamCdn() {
|
||||
override val name: String = "Vanfem"
|
||||
override val mainUrl: String = "https://vanfem.com"
|
||||
}
|
||||
|
||||
class Filelions : Filesim() {
|
||||
override val name = "Filelions"
|
||||
override var mainUrl = "https://filelions.live"
|
||||
}
|
|
@ -6,8 +6,3 @@ class Oppadrama : DramaidProvider() {
|
|||
override var mainUrl = "http://185.217.95.30"
|
||||
override var name = "Oppadrama"
|
||||
}
|
||||
|
||||
class Filelions : Filesim() {
|
||||
override val name = "Filelions"
|
||||
override var mainUrl = "https://filelions.live"
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
import org.jetbrains.kotlin.konan.properties.Properties
|
||||
|
||||
// use an integer for version numbers
|
||||
version = 22
|
||||
version = 23
|
||||
|
||||
android {
|
||||
defaultConfig {
|
||||
|
|
|
@ -6,9 +6,9 @@ import com.lagradost.cloudstream3.utils.httpsify
|
|||
import com.lagradost.cloudstream3.utils.loadExtractor
|
||||
|
||||
open class DutaMovie : Gomov() {
|
||||
override var mainUrl = "https://tv.dutamovie21.life"
|
||||
override var mainUrl = "https://tv5.dutamovie21.co"
|
||||
override var name = "DutaMovie"
|
||||
|
||||
override val imgAttr = "data-src"
|
||||
override val mainPage = mainPageOf(
|
||||
"category/box-office/page/%d/" to "Box Office",
|
||||
"category/serial-tv/page/%d/" to "Serial TV",
|
||||
|
|
|
@ -20,7 +20,7 @@ open class Gomov : MainAPI() {
|
|||
TvType.TvSeries,
|
||||
TvType.AsianDrama
|
||||
)
|
||||
|
||||
open val imgAttr = "src"
|
||||
private val sources = arrayOf("https://chillx.top", "https://watchx.top", "https://bestx.stream")
|
||||
|
||||
override val mainPage = mainPageOf(
|
||||
|
@ -47,7 +47,7 @@ open class Gomov : MainAPI() {
|
|||
private fun Element.toSearchResult(): SearchResponse? {
|
||||
val title = this.selectFirst("h2.entry-title > a")?.text()?.trim() ?: return null
|
||||
val href = fixUrl(this.selectFirst("a")!!.attr("href"))
|
||||
val posterUrl = fixUrlNull(this.selectFirst("a > img")?.attr("src"))?.fixImageQuality()
|
||||
val posterUrl = fixUrlNull(this.selectFirst("a > img")?.attr(imgAttr))?.fixImageQuality()
|
||||
val quality = this.select("div.gmr-qual, div.gmr-quality-item > a").text().trim().replace("-", "")
|
||||
return if (quality.isEmpty()) {
|
||||
val episode =
|
||||
|
@ -68,7 +68,7 @@ open class Gomov : MainAPI() {
|
|||
private fun Element.toRecommendResult(): SearchResponse? {
|
||||
val title = this.selectFirst("a > span.idmuvi-rp-title")?.text()?.trim() ?: return null
|
||||
val href = this.selectFirst("a")!!.attr("href")
|
||||
val posterUrl = fixUrlNull(this.selectFirst("a > img")?.attr("src").fixImageQuality())
|
||||
val posterUrl = fixUrlNull(this.selectFirst("a > img")?.attr(imgAttr).fixImageQuality())
|
||||
return newMovieSearchResponse(title, href, TvType.Movie) {
|
||||
this.posterUrl = posterUrl
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ open class Gomov : MainAPI() {
|
|||
document.selectFirst("h1.entry-title")?.text()?.substringBefore("Season")?.substringBefore("Episode")?.trim()
|
||||
.toString()
|
||||
val poster =
|
||||
fixUrlNull(document.selectFirst("figure.pull-left > img")?.attr("src"))?.fixImageQuality()
|
||||
fixUrlNull(document.selectFirst("figure.pull-left > img")?.attr(imgAttr))?.fixImageQuality()
|
||||
val tags = document.select("span.gmr-movie-genre:contains(Genre:) > a").map { it.text() }
|
||||
|
||||
val year =
|
||||
|
|
Loading…
Reference in a new issue