2022-10-26 15:38:46 +00:00
|
|
|
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.M3u8Helper
|
|
|
|
|
2022-10-31 19:47:15 +00:00
|
|
|
class MoviehabNet : Moviehab() {
|
2023-07-02 17:41:19 +00:00
|
|
|
override var mainUrl = "https://play.moviehab.asia"
|
2022-10-31 19:47:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
open class Moviehab : ExtractorApi() {
|
2022-10-26 15:38:46 +00:00
|
|
|
override var name = "Moviehab"
|
|
|
|
override var mainUrl = "https://play.moviehab.com"
|
|
|
|
override val requiresReferer = false
|
|
|
|
|
|
|
|
override suspend fun getUrl(
|
|
|
|
url: String,
|
|
|
|
referer: String?,
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
) {
|
|
|
|
val res = app.get(url)
|
|
|
|
res.document.select("video#player").let {
|
|
|
|
//should redirect first for making it works
|
|
|
|
val link = app.get("$mainUrl/${it.select("source").attr("src")}", referer = url).url
|
|
|
|
M3u8Helper.generateM3u8(
|
|
|
|
this.name,
|
|
|
|
link,
|
|
|
|
url
|
|
|
|
).forEach(callback)
|
|
|
|
|
|
|
|
Regex("src[\"|'],\\s[\"|'](\\S+)[\"|']\\)").find(res.text)?.groupValues?.get(1).let {sub ->
|
|
|
|
subtitleCallback.invoke(
|
|
|
|
SubtitleFile(
|
|
|
|
it.select("track").attr("label"),
|
|
|
|
"$mainUrl/$sub"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-07-02 17:41:19 +00:00
|
|
|
}
|