forked from recloudstream/cloudstream
[Extractor] AStreamHub (#129)
This commit is contained in:
parent
b83843d3ae
commit
03eb17149f
2 changed files with 40 additions and 0 deletions
|
@ -0,0 +1,39 @@
|
||||||
|
package com.lagradost.cloudstream3.extractors
|
||||||
|
|
||||||
|
import android.util.Log
|
||||||
|
import com.lagradost.cloudstream3.app
|
||||||
|
import com.lagradost.cloudstream3.base64Decode
|
||||||
|
import com.lagradost.cloudstream3.utils.*
|
||||||
|
|
||||||
|
class AStreamHub : ExtractorApi() {
|
||||||
|
override val name = "AStreamHub"
|
||||||
|
override val mainUrl = "https://astreamhub.com"
|
||||||
|
override val requiresReferer = true
|
||||||
|
|
||||||
|
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink> {
|
||||||
|
val sources = mutableListOf<ExtractorLink>()
|
||||||
|
app.get(url).document.selectFirst("body > script").let { script ->
|
||||||
|
val text = script?.html() ?: ""
|
||||||
|
Log.i("Dev", "text => $text")
|
||||||
|
if (text.isNotBlank()) {
|
||||||
|
val m3link = "(?<=file:)(.*)(?=,)".toRegex().find(text)
|
||||||
|
?.groupValues?.get(0)?.trim()?.trim('"') ?: ""
|
||||||
|
Log.i("Dev", "m3link => $m3link")
|
||||||
|
if (m3link.isNotBlank()) {
|
||||||
|
sources.add(
|
||||||
|
ExtractorLink(
|
||||||
|
name = name,
|
||||||
|
source = name,
|
||||||
|
url = m3link,
|
||||||
|
isM3u8 = true,
|
||||||
|
quality = Qualities.Unknown.value,
|
||||||
|
referer = referer ?: url
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sources
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -344,6 +344,7 @@ val extractorApis: MutableList<ExtractorApi> = arrayListOf(
|
||||||
VidSrcExtractor(),
|
VidSrcExtractor(),
|
||||||
VidSrcExtractor2(),
|
VidSrcExtractor2(),
|
||||||
PlayLtXyz(),
|
PlayLtXyz(),
|
||||||
|
AStreamHub(),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue