mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
fix
This commit is contained in:
parent
56cb3d7181
commit
a05616e3e8
1 changed files with 31 additions and 16 deletions
|
@ -10,24 +10,39 @@ open class Mp4Upload : ExtractorApi() {
|
||||||
override var name = "Mp4Upload"
|
override var name = "Mp4Upload"
|
||||||
override var mainUrl = "https://www.mp4upload.com"
|
override var mainUrl = "https://www.mp4upload.com"
|
||||||
private val srcRegex = Regex("""player\.src\("(.*?)"""")
|
private val srcRegex = Regex("""player\.src\("(.*?)"""")
|
||||||
override val requiresReferer = true
|
private val srcRegex2 = Regex("""player\.src\([\w\W]*src: "(.*?)"""")
|
||||||
|
|
||||||
|
override val requiresReferer = true
|
||||||
|
private val idMatch = Regex("""mp4upload\.com/(embed-|)([A-Za-z0-9]*)""")
|
||||||
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink>? {
|
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink>? {
|
||||||
with(app.get(url)) {
|
val realUrl = idMatch.find(url)?.groupValues?.get(2)?.let { id ->
|
||||||
getAndUnpack(this.text).let { unpackedText ->
|
"$mainUrl/embed-$id.html"
|
||||||
val quality = unpackedText.lowercase().substringAfter(" height=").substringBefore(" ").toIntOrNull()
|
} ?: url
|
||||||
srcRegex.find(unpackedText)?.groupValues?.get(1)?.let { link ->
|
val response = app.get(realUrl)
|
||||||
return listOf(
|
val unpackedText = getAndUnpack(response.text)
|
||||||
ExtractorLink(
|
val quality =
|
||||||
name,
|
unpackedText.lowercase().substringAfter(" height=").substringBefore(" ").toIntOrNull()
|
||||||
name,
|
srcRegex.find(unpackedText)?.groupValues?.get(1)?.let { link ->
|
||||||
link,
|
return listOf(
|
||||||
url,
|
ExtractorLink(
|
||||||
quality ?: Qualities.Unknown.value,
|
name,
|
||||||
)
|
name,
|
||||||
)
|
link,
|
||||||
}
|
url,
|
||||||
}
|
quality ?: Qualities.Unknown.value,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
srcRegex2.find(unpackedText)?.groupValues?.get(1)?.let { link ->
|
||||||
|
return listOf(
|
||||||
|
ExtractorLink(
|
||||||
|
name,
|
||||||
|
name,
|
||||||
|
link,
|
||||||
|
url,
|
||||||
|
quality ?: Qualities.Unknown.value,
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue