Merge branch 'recloudstream:master' into master

This commit is contained in:
KillerDogeEmpire 2022-10-01 09:21:27 -07:00 committed by GitHub
commit 73417190ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 1 deletions

View File

@ -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
}
}

View File

@ -244,7 +244,7 @@ class IndexSubtitleApi : AbstractSubApi {
} else {
document.select("div.my-3.p-3 div.media").mapNotNull { block ->
val name =
block.selectFirst("strong.d-block.text-primary")?.text()?.trim().toString()
block.selectFirst("strong.d-block")?.text()?.trim().toString()
if (seasonNum!! > 0) {
if (isRightEps(name, seasonNum, epNum)) {
fixUrl(block.selectFirst("a")!!.attr("href"))

View File

@ -344,6 +344,7 @@ val extractorApis: MutableList<ExtractorApi> = arrayListOf(
VidSrcExtractor(),
VidSrcExtractor2(),
PlayLtXyz(),
AStreamHub(),
)