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
02d09d3099
commit
507068832d
6 changed files with 53 additions and 49 deletions
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 6
|
||||
version = 7
|
||||
|
||||
|
||||
cloudstream {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.hexated
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty
|
||||
import com.lagradost.cloudstream3.*
|
||||
import com.lagradost.cloudstream3.extractors.XStreamCdn
|
||||
import com.lagradost.cloudstream3.network.WebViewResolver
|
||||
|
@ -202,7 +203,7 @@ object SoraExtractor : SoraStream() {
|
|||
subtitleCallback: (SubtitleFile) -> Unit,
|
||||
callback: (ExtractorLink) -> Unit
|
||||
) {
|
||||
val url = if(season == null) {
|
||||
val url = if (season == null) {
|
||||
"$movie123API/imdb.php?imdb=$imdbId&server=vcu"
|
||||
} else {
|
||||
"$movie123API/tmdb_api.php?se=$season&ep=$episode&tmdb=$tmdbId&server_name=vcu"
|
||||
|
@ -228,6 +229,39 @@ object SoraExtractor : SoraStream() {
|
|||
)
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun invokeMovieHab(
|
||||
id: Int? = null,
|
||||
season: Int? = null,
|
||||
episode: Int? = null,
|
||||
subtitleCallback: (SubtitleFile) -> Unit,
|
||||
callback: (ExtractorLink) -> Unit
|
||||
) {
|
||||
val url = if (season == null) {
|
||||
"$movieHabAPI/embed/movie?tmdb=$id"
|
||||
} else {
|
||||
"$movieHabAPI/embed/series?tmdb=$id&sea=$season&epi=$episode"
|
||||
}
|
||||
|
||||
val doc = app.get(url, referer = "$movieHabAPI/").document
|
||||
val movieId = doc.select("div#embed-player").attr("data-movie-id")
|
||||
|
||||
doc.select("div.dropdown-menu a").apmap {
|
||||
val dataId = it.attr("data-id")
|
||||
app.get(
|
||||
"$movieHabAPI/ajax/get_stream_link?id=$dataId&movie=$movieId&is_init=true&captcha=&ref=",
|
||||
referer = url,
|
||||
headers = mapOf("X-Requested-With" to "XMLHttpRequest")
|
||||
).parsedSafe<MovieHabRes>()?.data?.let { res ->
|
||||
loadExtractor(
|
||||
res.link ?: return@let null,
|
||||
movieHabAPI,
|
||||
subtitleCallback,
|
||||
callback
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun getQuality(str: String): Int {
|
||||
|
@ -300,4 +334,13 @@ suspend fun loadLinksWithWebView(
|
|||
true
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private data class MovieHabData(
|
||||
@JsonProperty("link") val link: String? = null,
|
||||
@JsonProperty("token") val token: String? = null,
|
||||
)
|
||||
|
||||
private data class MovieHabRes(
|
||||
@JsonProperty("data") val data: MovieHabData? = null,
|
||||
)
|
|
@ -5,6 +5,7 @@ import com.hexated.RandomUserAgent.getRandomUserAgent
|
|||
import com.hexated.SoraExtractor.invoke123Movie
|
||||
import com.hexated.SoraExtractor.invokeDbgo
|
||||
import com.hexated.SoraExtractor.invokeLocalSources
|
||||
import com.hexated.SoraExtractor.invokeMovieHab
|
||||
import com.hexated.SoraExtractor.invokeOlgply
|
||||
import com.hexated.SoraExtractor.invokeTwoEmbed
|
||||
import com.hexated.SoraExtractor.invokeVidSrc
|
||||
|
@ -39,6 +40,7 @@ open class SoraStream : TmdbProvider() {
|
|||
const val vidSrcAPI = "https://v2.vidsrc.me"
|
||||
const val dbgoAPI = "https://dbgo.fun"
|
||||
const val movie123API = "https://api.123movie.cc"
|
||||
const val movieHabAPI = "https://moviehab.com"
|
||||
|
||||
fun getType(t: String?): TvType {
|
||||
return when (t) {
|
||||
|
@ -263,14 +265,10 @@ open class SoraStream : TmdbProvider() {
|
|||
invokeDbgo(res.imdbId, res.season, res.episode, subtitleCallback, callback)
|
||||
},
|
||||
{
|
||||
invoke123Movie(
|
||||
res.id,
|
||||
res.imdbId,
|
||||
res.season,
|
||||
res.episode,
|
||||
subtitleCallback,
|
||||
callback
|
||||
)
|
||||
invoke123Movie(res.id, res.imdbId, res.season, res.episode, subtitleCallback, callback)
|
||||
},
|
||||
{
|
||||
invokeMovieHab(res.id, res.season, res.episode, subtitleCallback, callback)
|
||||
})
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue