mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
fix #263
This commit is contained in:
parent
6cdeb65922
commit
c6f89db48a
3 changed files with 15 additions and 1 deletions
|
@ -1,7 +1,7 @@
|
||||||
import org.jetbrains.kotlin.konan.properties.Properties
|
import org.jetbrains.kotlin.konan.properties.Properties
|
||||||
|
|
||||||
// use an integer for version numbers
|
// use an integer for version numbers
|
||||||
version = 166
|
version = 167
|
||||||
|
|
||||||
android {
|
android {
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
|
|
|
@ -1100,7 +1100,9 @@ object SoraExtractor : SoraStream() {
|
||||||
val driveReq = app.get(driveLink)
|
val driveReq = app.get(driveLink)
|
||||||
val driveRes = driveReq.document
|
val driveRes = driveReq.document
|
||||||
val bitLink = driveRes.select("a.btn.btn-outline-success").attr("href")
|
val bitLink = driveRes.select("a.btn.btn-outline-success").attr("href")
|
||||||
|
val insLink = driveRes.select("a.btn.btn-danger:contains(Instant Download)").attr("href")
|
||||||
val downloadLink = when {
|
val downloadLink = when {
|
||||||
|
insLink.isNotEmpty() -> extractInstantUHD(insLink)
|
||||||
driveRes.select("button.btn.btn-success").text()
|
driveRes.select("button.btn.btn-success").text()
|
||||||
.contains("Direct Download", true) -> extractDirectUHD(driveLink, driveReq)
|
.contains("Direct Download", true) -> extractDirectUHD(driveLink, driveReq)
|
||||||
bitLink.isNullOrEmpty() -> {
|
bitLink.isNullOrEmpty() -> {
|
||||||
|
|
|
@ -163,6 +163,18 @@ suspend fun extractMirrorUHD(url: String, ref: String): String? {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
suspend fun extractInstantUHD(url: String): String? {
|
||||||
|
val host = getBaseUrl(url)
|
||||||
|
val body = FormBody.Builder()
|
||||||
|
.addEncoded("keys", url.substringAfter("url="))
|
||||||
|
.build()
|
||||||
|
return app.post(
|
||||||
|
"$host/api", requestBody = body, headers = mapOf(
|
||||||
|
"x-token" to "${url.toUri().host}"
|
||||||
|
), referer = "$host/"
|
||||||
|
).parsedSafe<Map<String, String>>()?.get("url")
|
||||||
|
}
|
||||||
|
|
||||||
suspend fun extractDirectUHD(url: String, niceResponse: NiceResponse): String? {
|
suspend fun extractDirectUHD(url: String, niceResponse: NiceResponse): String? {
|
||||||
val document = niceResponse.document
|
val document = niceResponse.document
|
||||||
val script = document.selectFirst("script:containsData(cf_token)")?.data() ?: return null
|
val script = document.selectFirst("script:containsData(cf_token)")?.data() ?: return null
|
||||||
|
|
Loading…
Reference in a new issue