mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
fixed several providers
This commit is contained in:
parent
8fbd218574
commit
3f2f8d8000
8 changed files with 45 additions and 36 deletions
|
@ -1,5 +1,5 @@
|
||||||
// use an integer for version numbers
|
// use an integer for version numbers
|
||||||
version = 7
|
version = 8
|
||||||
|
|
||||||
|
|
||||||
cloudstream {
|
cloudstream {
|
||||||
|
|
|
@ -81,6 +81,7 @@ class Hdfilmcehennemi : MainAPI() {
|
||||||
val document = app.get(url).document
|
val document = app.get(url).document
|
||||||
|
|
||||||
val title = document.selectFirst("div.card-header > h1, div.card-header > h2")?.text()
|
val title = document.selectFirst("div.card-header > h1, div.card-header > h2")?.text()
|
||||||
|
?.removeSuffix("Filminin Bilgileri")?.trim()
|
||||||
?: return null
|
?: return null
|
||||||
val poster = fixUrlNull(document.selectFirst("img.img-fluid")?.attr("src"))
|
val poster = fixUrlNull(document.selectFirst("img.img-fluid")?.attr("src"))
|
||||||
val tags = document.select("div.mb-0.lh-lg div:nth-child(5) a").map { it.text() }
|
val tags = document.select("div.mb-0.lh-lg div:nth-child(5) a").map { it.text() }
|
||||||
|
|
|
@ -25,12 +25,6 @@ class Loklok : MainAPI() {
|
||||||
TvType.AsianDrama,
|
TvType.AsianDrama,
|
||||||
)
|
)
|
||||||
|
|
||||||
private val headers = mutableMapOf(
|
|
||||||
"lang" to "en",
|
|
||||||
"versioncode" to "33",
|
|
||||||
"clienttype" to "android_tem3",
|
|
||||||
)
|
|
||||||
|
|
||||||
// no license found
|
// no license found
|
||||||
// thanks to https://github.com/napthedev/filmhot for providing API
|
// thanks to https://github.com/napthedev/filmhot for providing API
|
||||||
companion object {
|
companion object {
|
||||||
|
@ -38,6 +32,12 @@ class Loklok : MainAPI() {
|
||||||
private val apiUrl = "$api/${base64Decode("Y21zL2FwcA==")}"
|
private val apiUrl = "$api/${base64Decode("Y21zL2FwcA==")}"
|
||||||
private val searchApi = base64Decode("aHR0cHM6Ly9sb2tsb2suY29t")
|
private val searchApi = base64Decode("aHR0cHM6Ly9sb2tsb2suY29t")
|
||||||
private const val mainImageUrl = "https://images.weserv.nl"
|
private const val mainImageUrl = "https://images.weserv.nl"
|
||||||
|
private val headers = mutableMapOf(
|
||||||
|
"lang" to "en",
|
||||||
|
"versioncode" to "33",
|
||||||
|
"clienttype" to "android_tem3",
|
||||||
|
"deviceid" to getDeviceId()
|
||||||
|
)
|
||||||
|
|
||||||
private fun base64DecodeAPI(api: String): String {
|
private fun base64DecodeAPI(api: String): String {
|
||||||
return api.chunked(4).map { base64Decode(it) }.reversed().joinToString("")
|
return api.chunked(4).map { base64Decode(it) }.reversed().joinToString("")
|
||||||
|
@ -132,8 +132,6 @@ class Loklok : MainAPI() {
|
||||||
headers = headers
|
headers = headers
|
||||||
).parsedSafe<Load>()?.data ?: throw ErrorLoadingException("Invalid Json Reponse")
|
).parsedSafe<Load>()?.data ?: throw ErrorLoadingException("Invalid Json Reponse")
|
||||||
|
|
||||||
headers["deviceid"] = getDevideId()
|
|
||||||
|
|
||||||
val actors = res.starList?.mapNotNull {
|
val actors = res.starList?.mapNotNull {
|
||||||
Actor(
|
Actor(
|
||||||
it.localName ?: return@mapNotNull null, it.image
|
it.localName ?: return@mapNotNull null, it.image
|
||||||
|
@ -269,13 +267,6 @@ class Loklok : MainAPI() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getDevideId(length: Int = 16): String {
|
|
||||||
val allowedChars = ('a'..'f') + ('0'..'9')
|
|
||||||
return (1..length)
|
|
||||||
.map { allowedChars.random() }
|
|
||||||
.joinToString("")
|
|
||||||
}
|
|
||||||
|
|
||||||
private suspend fun getTracker(title: String?, type: String?, year: Int?): Tracker {
|
private suspend fun getTracker(title: String?, type: String?, year: Int?): Tracker {
|
||||||
val res = app.get("https://api.consumet.org/meta/anilist/$title")
|
val res = app.get("https://api.consumet.org/meta/anilist/$title")
|
||||||
.parsedSafe<AniSearch>()?.results?.find { media ->
|
.parsedSafe<AniSearch>()?.results?.find { media ->
|
||||||
|
@ -428,3 +419,10 @@ class Loklok : MainAPI() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getDeviceId(length: Int = 16): String {
|
||||||
|
val allowedChars = ('a'..'f') + ('0'..'9')
|
||||||
|
return (1..length)
|
||||||
|
.map { allowedChars.random() }
|
||||||
|
.joinToString("")
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// use an integer for version numbers
|
// use an integer for version numbers
|
||||||
version = 9
|
version = 10
|
||||||
|
|
||||||
|
|
||||||
cloudstream {
|
cloudstream {
|
||||||
|
|
|
@ -5,13 +5,14 @@ import com.lagradost.cloudstream3.*
|
||||||
import com.lagradost.cloudstream3.LoadResponse.Companion.addAniListId
|
import com.lagradost.cloudstream3.LoadResponse.Companion.addAniListId
|
||||||
import com.lagradost.cloudstream3.LoadResponse.Companion.addMalId
|
import com.lagradost.cloudstream3.LoadResponse.Companion.addMalId
|
||||||
import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
|
import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
|
||||||
|
import com.lagradost.cloudstream3.extractors.Filesim
|
||||||
import com.lagradost.cloudstream3.utils.*
|
import com.lagradost.cloudstream3.utils.*
|
||||||
import org.jsoup.Jsoup
|
import org.jsoup.Jsoup
|
||||||
import org.jsoup.nodes.Element
|
import org.jsoup.nodes.Element
|
||||||
import java.util.ArrayList
|
import java.util.ArrayList
|
||||||
|
|
||||||
class OploverzProvider : MainAPI() {
|
class OploverzProvider : MainAPI() {
|
||||||
override var mainUrl = "https://15.235.11.45"
|
override var mainUrl = "https://oploverz.tv"
|
||||||
override var name = "Oploverz"
|
override var name = "Oploverz"
|
||||||
override val hasMainPage = true
|
override val hasMainPage = true
|
||||||
override var lang = "id"
|
override var lang = "id"
|
||||||
|
@ -25,7 +26,8 @@ class OploverzProvider : MainAPI() {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val acefile = "https://acefile.co"
|
const val acefile = "https://acefile.co"
|
||||||
const val linkbox = "https://lbx.to"
|
const val lbx = "https://lbx.to"
|
||||||
|
const val linkbox = "https://www.linkbox.to"
|
||||||
|
|
||||||
fun getType(t: String): TvType {
|
fun getType(t: String): TvType {
|
||||||
return when {
|
return when {
|
||||||
|
@ -200,13 +202,13 @@ class OploverzProvider : MainAPI() {
|
||||||
if (streamingSources.isNotEmpty()) sources.addAll(streamingSources)
|
if (streamingSources.isNotEmpty()) sources.addAll(streamingSources)
|
||||||
|
|
||||||
val downloadSources =
|
val downloadSources =
|
||||||
document.select("div.bixbox div.soraddlx.soradlg").lastOrNull()?.select("div.soraurlx")
|
document.select("div.mctnx div:contains(mp4) div.soraurlx").mapNotNull { item ->
|
||||||
?.map { item ->
|
item.select("a").map { item.select("strong").text() to it.attr("href") }
|
||||||
item.select("a").map { item.select("strong").text() to it.attr("href") }
|
}.flatten()
|
||||||
}?.flatten()
|
if (downloadSources.isNotEmpty()) sources.addAll(downloadSources)
|
||||||
if (downloadSources?.isNotEmpty() == true) sources.addAll(downloadSources)
|
|
||||||
|
|
||||||
sources.apmap { (quality, source) ->
|
sources.filter { it.second.startsWith("https") }.
|
||||||
|
apmap { (quality, source) ->
|
||||||
loadExtractor(fixedIframe(source), data, subtitleCallback) { link ->
|
loadExtractor(fixedIframe(source), data, subtitleCallback) { link ->
|
||||||
callback.invoke(
|
callback.invoke(
|
||||||
ExtractorLink(
|
ExtractorLink(
|
||||||
|
@ -226,11 +228,14 @@ class OploverzProvider : MainAPI() {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun fixedIframe(url: String): String {
|
private suspend fun fixedIframe(url: String): String {
|
||||||
val id = Regex("""/f/(\S+)/|/file/(\S+)/""").find(url)?.groupValues?.getOrNull(1)
|
val id = Regex("""(?:/f/|/file/)(\w+)""").find(url)?.groupValues?.getOrNull(1)
|
||||||
return when {
|
return when {
|
||||||
url.startsWith(acefile) -> "$acefile/player/$id"
|
url.startsWith(acefile) -> "$acefile/player/$id"
|
||||||
url.startsWith(linkbox) -> "https://www.linkbox.to/a/f/$id"
|
url.startsWith(lbx) -> {
|
||||||
|
val itemId = app.get("$linkbox/api/file/share_out_list/?sortField=utime&sortAsc=0&pageNo=1&pageSize=50&shareToken=$id&scene=singleItem&needTpInfo=1&lan=en").parsedSafe<Responses>()?.data?.itemId
|
||||||
|
"$linkbox/a/f/$itemId"
|
||||||
|
}
|
||||||
else -> url
|
else -> url
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -278,7 +283,8 @@ class OploverzProvider : MainAPI() {
|
||||||
)
|
)
|
||||||
|
|
||||||
data class Data(
|
data class Data(
|
||||||
@JsonProperty("rList") val rList: List<RList>?,
|
@JsonProperty("rList") val rList: List<RList>? = arrayListOf(),
|
||||||
|
@JsonProperty("itemId") val itemId: String? = null,
|
||||||
)
|
)
|
||||||
|
|
||||||
data class Responses(
|
data class Responses(
|
||||||
|
@ -286,3 +292,8 @@ class OploverzProvider : MainAPI() {
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class Streamhide : Filesim() {
|
||||||
|
override val mainUrl = "https://streamhide.to"
|
||||||
|
override val name = "Streamhide"
|
||||||
|
}
|
|
@ -10,5 +10,6 @@ class OploverzProviderPlugin: Plugin() {
|
||||||
override fun load(context: Context) {
|
override fun load(context: Context) {
|
||||||
// All providers should be added in this manner. Please don't edit the providers list directly.
|
// All providers should be added in this manner. Please don't edit the providers list directly.
|
||||||
registerMainAPI(OploverzProvider())
|
registerMainAPI(OploverzProvider())
|
||||||
|
registerExtractorAPI(Streamhide())
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1373,9 +1373,7 @@ object SoraExtractor : SoraStream() {
|
||||||
it.select("img").attr("src")
|
it.select("img").attr("src")
|
||||||
)
|
)
|
||||||
}.filter {
|
}.filter {
|
||||||
(it.quality.contains("1080p", true) || it.quality.contains(
|
it.quality.contains(Regex("(?i)(1080p|4k)")) && it.type.contains(Regex("(gdtot|oiya)"))
|
||||||
"4k", true
|
|
||||||
)) && (it.type.contains("gdtot") || it.type.contains("oiya"))
|
|
||||||
}
|
}
|
||||||
iframe.apmap { (link, quality, size, type) ->
|
iframe.apmap { (link, quality, size, type) ->
|
||||||
val qualities = getFDoviesQuality(quality)
|
val qualities = getFDoviesQuality(quality)
|
||||||
|
@ -2517,7 +2515,7 @@ object SoraExtractor : SoraStream() {
|
||||||
episode: Int? = null,
|
episode: Int? = null,
|
||||||
callback: (ExtractorLink) -> Unit,
|
callback: (ExtractorLink) -> Unit,
|
||||||
) {
|
) {
|
||||||
val query = getIndexQuery(title, year, season, episode)
|
val query = getIndexQuery(title, null, season, episode)
|
||||||
val files = app.get("$gdbot/search?q=$query").document.select("ul.divide-y li").map {
|
val files = app.get("$gdbot/search?q=$query").document.select("ul.divide-y li").map {
|
||||||
Triple(
|
Triple(
|
||||||
it.select("a").attr("href"),
|
it.select("a").attr("href"),
|
||||||
|
|
|
@ -788,11 +788,11 @@ fun getIndexQuery(
|
||||||
episode: Int? = null
|
episode: Int? = null
|
||||||
): String {
|
): String {
|
||||||
val (seasonSlug, episodeSlug) = getEpisodeSlug(season, episode)
|
val (seasonSlug, episodeSlug) = getEpisodeSlug(season, episode)
|
||||||
return if (season == null) {
|
return (if (season == null) {
|
||||||
"$title $year"
|
"$title ${year ?: ""}"
|
||||||
} else {
|
} else {
|
||||||
"$title S${seasonSlug}E${episodeSlug}"
|
"$title S${seasonSlug}E${episodeSlug}"
|
||||||
}
|
}).trim()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun searchIndex(
|
fun searchIndex(
|
||||||
|
|
Loading…
Reference in a new issue