mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
fixed Linkbox (#319)
This commit is contained in:
parent
8e928a8a2b
commit
9fd2e84c7a
3 changed files with 12 additions and 12 deletions
|
@ -27,7 +27,6 @@ open class Acefile : ExtractorApi() {
|
||||||
res.substringAfter("\"file\":\"").substringBefore("\","),
|
res.substringAfter("\"file\":\"").substringBefore("\","),
|
||||||
"$mainUrl/",
|
"$mainUrl/",
|
||||||
Qualities.Unknown.value,
|
Qualities.Unknown.value,
|
||||||
headers = mapOf("range" to "bytes=0-")
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.lagradost.cloudstream3.extractors
|
package com.lagradost.cloudstream3.extractors
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty
|
import com.fasterxml.jackson.annotation.JsonProperty
|
||||||
|
import com.lagradost.cloudstream3.SubtitleFile
|
||||||
import com.lagradost.cloudstream3.app
|
import com.lagradost.cloudstream3.app
|
||||||
import com.lagradost.cloudstream3.utils.ExtractorApi
|
import com.lagradost.cloudstream3.utils.ExtractorApi
|
||||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||||
|
@ -11,12 +12,15 @@ open class Linkbox : ExtractorApi() {
|
||||||
override val mainUrl = "https://www.linkbox.to"
|
override val mainUrl = "https://www.linkbox.to"
|
||||||
override val requiresReferer = true
|
override val requiresReferer = true
|
||||||
|
|
||||||
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink> {
|
override suspend fun getUrl(
|
||||||
val id = url.substringAfter("id=")
|
url: String,
|
||||||
val sources = mutableListOf<ExtractorLink>()
|
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 ->
|
app.get("$mainUrl/api/open/get_url?itemId=$id", referer=url).parsedSafe<Responses>()?.data?.rList?.map { link ->
|
||||||
sources.add(
|
callback.invoke(
|
||||||
ExtractorLink(
|
ExtractorLink(
|
||||||
name,
|
name,
|
||||||
name,
|
name,
|
||||||
|
@ -26,8 +30,6 @@ open class Linkbox : ExtractorApi() {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
return sources
|
|
||||||
}
|
}
|
||||||
|
|
||||||
data class RList(
|
data class RList(
|
||||||
|
|
|
@ -4,7 +4,6 @@ import android.util.Log
|
||||||
import com.lagradost.cloudstream3.TvType
|
import com.lagradost.cloudstream3.TvType
|
||||||
import com.lagradost.cloudstream3.app
|
import com.lagradost.cloudstream3.app
|
||||||
import com.lagradost.cloudstream3.imdbUrlToIdNullable
|
import com.lagradost.cloudstream3.imdbUrlToIdNullable
|
||||||
import com.lagradost.cloudstream3.network.CloudflareKiller
|
|
||||||
import com.lagradost.cloudstream3.subtitles.AbstractSubApi
|
import com.lagradost.cloudstream3.subtitles.AbstractSubApi
|
||||||
import com.lagradost.cloudstream3.subtitles.AbstractSubtitleEntities
|
import com.lagradost.cloudstream3.subtitles.AbstractSubtitleEntities
|
||||||
import com.lagradost.cloudstream3.utils.SubtitleHelper
|
import com.lagradost.cloudstream3.utils.SubtitleHelper
|
||||||
|
@ -22,7 +21,7 @@ class IndexSubtitleApi : AbstractSubApi {
|
||||||
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val host = "https://subscene.cyou"
|
const val host = "https://indexsubtitle.com"
|
||||||
const val TAG = "INDEXSUBS"
|
const val TAG = "INDEXSUBS"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,7 +241,7 @@ class IndexSubtitleApi : AbstractSubApi {
|
||||||
document.selectFirst("div.my-3.p-3 div.media a")!!.attr("href")
|
document.selectFirst("div.my-3.p-3 div.media a")!!.attr("href")
|
||||||
)
|
)
|
||||||
} else {
|
} 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 =
|
val name =
|
||||||
block.selectFirst("strong.d-block")?.text()?.trim().toString()
|
block.selectFirst("strong.d-block")?.text()?.trim().toString()
|
||||||
if (seasonNum!! > 0) {
|
if (seasonNum!! > 0) {
|
||||||
|
@ -254,7 +253,7 @@ class IndexSubtitleApi : AbstractSubApi {
|
||||||
} else {
|
} else {
|
||||||
fixUrl(block.selectFirst("a")!!.attr("href"))
|
fixUrl(block.selectFirst("a")!!.attr("href"))
|
||||||
}
|
}
|
||||||
}.first()
|
}
|
||||||
}
|
}
|
||||||
return link
|
return link
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue