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,12 +10,18 @@ open class Mp4Upload : ExtractorApi() {
|
|||
override var name = "Mp4Upload"
|
||||
override var mainUrl = "https://www.mp4upload.com"
|
||||
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>? {
|
||||
with(app.get(url)) {
|
||||
getAndUnpack(this.text).let { unpackedText ->
|
||||
val quality = unpackedText.lowercase().substringAfter(" height=").substringBefore(" ").toIntOrNull()
|
||||
val realUrl = idMatch.find(url)?.groupValues?.get(2)?.let { id ->
|
||||
"$mainUrl/embed-$id.html"
|
||||
} ?: url
|
||||
val response = app.get(realUrl)
|
||||
val unpackedText = getAndUnpack(response.text)
|
||||
val quality =
|
||||
unpackedText.lowercase().substringAfter(" height=").substringBefore(" ").toIntOrNull()
|
||||
srcRegex.find(unpackedText)?.groupValues?.get(1)?.let { link ->
|
||||
return listOf(
|
||||
ExtractorLink(
|
||||
|
@ -27,7 +33,16 @@ open class Mp4Upload : ExtractorApi() {
|
|||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
srcRegex2.find(unpackedText)?.groupValues?.get(1)?.let { link ->
|
||||
return listOf(
|
||||
ExtractorLink(
|
||||
name,
|
||||
name,
|
||||
link,
|
||||
url,
|
||||
quality ?: Qualities.Unknown.value,
|
||||
)
|
||||
)
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue