added Moviehab extractor

This commit is contained in:
hexated 2022-10-18 22:05:35 +07:00
parent 8ed5c8354d
commit 03bdad96df
2 changed files with 41 additions and 0 deletions

View file

@ -0,0 +1,40 @@
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
class Moviehab : ExtractorApi() {
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"
)
)
}
}
}
}

View file

@ -326,6 +326,7 @@ val extractorApis: MutableList<ExtractorApi> = arrayListOf(
Vidmoly(), Vidmoly(),
Vidmolyme(), Vidmolyme(),
Voe(), Voe(),
Moviehab(),
Gdriveplayerapi(), Gdriveplayerapi(),
Gdriveplayerapp(), Gdriveplayerapp(),