mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
added source to SoraExtractor
This commit is contained in:
parent
dfe775f668
commit
1fdbda806d
4 changed files with 41 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
||||||
// use an integer for version numbers
|
// use an integer for version numbers
|
||||||
version = 5
|
version = 6
|
||||||
|
|
||||||
|
|
||||||
cloudstream {
|
cloudstream {
|
||||||
|
|
|
@ -1,13 +1,18 @@
|
||||||
package com.hexated
|
package com.hexated
|
||||||
|
|
||||||
import android.util.Log
|
|
||||||
import com.lagradost.cloudstream3.*
|
import com.lagradost.cloudstream3.*
|
||||||
|
import com.lagradost.cloudstream3.extractors.XStreamCdn
|
||||||
import com.lagradost.cloudstream3.network.WebViewResolver
|
import com.lagradost.cloudstream3.network.WebViewResolver
|
||||||
import com.lagradost.cloudstream3.utils.*
|
import com.lagradost.cloudstream3.utils.*
|
||||||
import com.lagradost.nicehttp.requestCreator
|
import com.lagradost.nicehttp.requestCreator
|
||||||
import java.net.URI
|
import java.net.URI
|
||||||
import java.util.ArrayList
|
import java.util.ArrayList
|
||||||
|
|
||||||
|
class EmbedSito : XStreamCdn() {
|
||||||
|
override val name: String = "EmbedSito"
|
||||||
|
override val mainUrl: String = "https://embedsito.com"
|
||||||
|
}
|
||||||
|
|
||||||
object SoraExtractor : SoraStream() {
|
object SoraExtractor : SoraStream() {
|
||||||
|
|
||||||
suspend fun invokeLocalSources(
|
suspend fun invokeLocalSources(
|
||||||
|
@ -71,7 +76,6 @@ object SoraExtractor : SoraStream() {
|
||||||
"$twoEmbedAPI/ajax/embed/play?id=$serverID&_token=$token",
|
"$twoEmbedAPI/ajax/embed/play?id=$serverID&_token=$token",
|
||||||
referer = url
|
referer = url
|
||||||
).parsedSafe<EmbedJson>()?.let { source ->
|
).parsedSafe<EmbedJson>()?.let { source ->
|
||||||
Log.i("hexated", "${source.link}")
|
|
||||||
loadExtractor(
|
loadExtractor(
|
||||||
source.link ?: return@let null,
|
source.link ?: return@let null,
|
||||||
twoEmbedAPI,
|
twoEmbedAPI,
|
||||||
|
@ -195,6 +199,33 @@ object SoraExtractor : SoraStream() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
suspend fun invoke123Movie(
|
||||||
|
id: String? = null,
|
||||||
|
subtitleCallback: (SubtitleFile) -> Unit,
|
||||||
|
callback: (ExtractorLink) -> Unit
|
||||||
|
) {
|
||||||
|
val url = "$movie123API/imdb.php?imdb=$id&server=vcu"
|
||||||
|
val iframe = app.get(url).document.selectFirst("iframe")?.attr("src")
|
||||||
|
|
||||||
|
val doc = app.get(
|
||||||
|
"$iframe",
|
||||||
|
referer = url,
|
||||||
|
headers = mapOf("Accept" to "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8")
|
||||||
|
).document
|
||||||
|
|
||||||
|
doc.select("ul.list-server-items li.linkserver").mapNotNull { server ->
|
||||||
|
server.attr("data-video").let {
|
||||||
|
Regex("(.*?)((\\?cap)|(\\?sub)|(#cap)|(#sub))").find(it)?.groupValues?.get(1)
|
||||||
|
}
|
||||||
|
}.apmap { link ->
|
||||||
|
loadExtractor(
|
||||||
|
link,
|
||||||
|
"https://123moviesjr.cc/",
|
||||||
|
subtitleCallback,
|
||||||
|
callback
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getQuality(str: String): Int {
|
private fun getQuality(str: String): Int {
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.hexated
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty
|
import com.fasterxml.jackson.annotation.JsonProperty
|
||||||
import com.hexated.RandomUserAgent.getRandomUserAgent
|
import com.hexated.RandomUserAgent.getRandomUserAgent
|
||||||
|
import com.hexated.SoraExtractor.invoke123Movie
|
||||||
import com.hexated.SoraExtractor.invokeDbgo
|
import com.hexated.SoraExtractor.invokeDbgo
|
||||||
import com.hexated.SoraExtractor.invokeLocalSources
|
import com.hexated.SoraExtractor.invokeLocalSources
|
||||||
import com.hexated.SoraExtractor.invokeOlgply
|
import com.hexated.SoraExtractor.invokeOlgply
|
||||||
|
@ -36,7 +37,8 @@ open class SoraStream : TmdbProvider() {
|
||||||
base64DecodeAPI("cA==YXA=bC4=Y2U=ZXI=LnY=aWU=b3Y=LW0=cmE=c28=Ly8=czo=dHA=aHQ=")
|
base64DecodeAPI("cA==YXA=bC4=Y2U=ZXI=LnY=aWU=b3Y=LW0=cmE=c28=Ly8=czo=dHA=aHQ=")
|
||||||
const val twoEmbedAPI = "https://www.2embed.to"
|
const val twoEmbedAPI = "https://www.2embed.to"
|
||||||
const val vidSrcAPI = "https://v2.vidsrc.me"
|
const val vidSrcAPI = "https://v2.vidsrc.me"
|
||||||
const val dbgoAPI = " https://dbgo.fun"
|
const val dbgoAPI = "https://dbgo.fun"
|
||||||
|
const val movie123API = "https://api.123movie.cc"
|
||||||
|
|
||||||
fun getType(t: String?): TvType {
|
fun getType(t: String?): TvType {
|
||||||
return when (t) {
|
return when (t) {
|
||||||
|
@ -259,6 +261,9 @@ open class SoraStream : TmdbProvider() {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
invokeDbgo(res.imdbId, res.season, res.episode, subtitleCallback, callback)
|
invokeDbgo(res.imdbId, res.season, res.episode, subtitleCallback, callback)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
if (res.type == "movie") invoke123Movie(res.imdbId, subtitleCallback, callback)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -10,5 +10,6 @@ class SoraStreamPlugin: 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(SoraStream())
|
registerMainAPI(SoraStream())
|
||||||
|
registerExtractorAPI(EmbedSito())
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue