fixed Linkbox (#319)

This commit is contained in:
Hexated 2023-01-20 06:44:26 +07:00 committed by GitHub
parent 8e928a8a2b
commit 9fd2e84c7a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 12 deletions

View file

@ -27,7 +27,6 @@ open class Acefile : ExtractorApi() {
res.substringAfter("\"file\":\"").substringBefore("\","),
"$mainUrl/",
Qualities.Unknown.value,
headers = mapOf("range" to "bytes=0-")
)
)
}

View file

@ -1,6 +1,7 @@
package com.lagradost.cloudstream3.extractors
import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.SubtitleFile
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.utils.ExtractorApi
import com.lagradost.cloudstream3.utils.ExtractorLink
@ -11,12 +12,15 @@ open class Linkbox : ExtractorApi() {
override val mainUrl = "https://www.linkbox.to"
override val requiresReferer = true
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink> {
val id = url.substringAfter("id=")
val sources = mutableListOf<ExtractorLink>()
override suspend fun getUrl(
url: String,
referer: String?,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
val id = Regex("""(/file/|id=)(\S+)[&/?]""").find(url)?.groupValues?.get(2)
app.get("$mainUrl/api/open/get_url?itemId=$id", referer=url).parsedSafe<Responses>()?.data?.rList?.map { link ->
sources.add(
callback.invoke(
ExtractorLink(
name,
name,
@ -26,8 +30,6 @@ open class Linkbox : ExtractorApi() {
)
)
}
return sources
}
data class RList(

View file

@ -4,7 +4,6 @@ import android.util.Log
import com.lagradost.cloudstream3.TvType
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.imdbUrlToIdNullable
import com.lagradost.cloudstream3.network.CloudflareKiller
import com.lagradost.cloudstream3.subtitles.AbstractSubApi
import com.lagradost.cloudstream3.subtitles.AbstractSubtitleEntities
import com.lagradost.cloudstream3.utils.SubtitleHelper
@ -22,7 +21,7 @@ class IndexSubtitleApi : AbstractSubApi {
companion object {
const val host = "https://subscene.cyou"
const val host = "https://indexsubtitle.com"
const val TAG = "INDEXSUBS"
}
@ -242,7 +241,7 @@ class IndexSubtitleApi : AbstractSubApi {
document.selectFirst("div.my-3.p-3 div.media a")!!.attr("href")
)
} else {
document.select("div.my-3.p-3 div.media").mapNotNull { block ->
document.select("div.my-3.p-3 div.media").firstNotNullOf { block ->
val name =
block.selectFirst("strong.d-block")?.text()?.trim().toString()
if (seasonNum!! > 0) {
@ -254,7 +253,7 @@ class IndexSubtitleApi : AbstractSubApi {
} else {
fixUrl(block.selectFirst("a")!!.attr("href"))
}
}.first()
}
}
return link
}