mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
added Moviehab extractor
This commit is contained in:
parent
8ed5c8354d
commit
03bdad96df
2 changed files with 41 additions and 0 deletions
|
@ -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"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -326,6 +326,7 @@ val extractorApis: MutableList<ExtractorApi> = arrayListOf(
|
||||||
Vidmoly(),
|
Vidmoly(),
|
||||||
Vidmolyme(),
|
Vidmolyme(),
|
||||||
Voe(),
|
Voe(),
|
||||||
|
Moviehab(),
|
||||||
|
|
||||||
Gdriveplayerapi(),
|
Gdriveplayerapi(),
|
||||||
Gdriveplayerapp(),
|
Gdriveplayerapp(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue