mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
Merge branch 'hexated:master' into master
This commit is contained in:
commit
64522e4433
4 changed files with 137 additions and 14 deletions
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 91
|
||||
version = 93
|
||||
|
||||
|
||||
cloudstream {
|
||||
|
|
|
@ -1904,7 +1904,7 @@ object SoraExtractor : SoraStream() {
|
|||
"$smashyStreamAPI/playere.php?imdb=$imdbId&season=$season&episode=$episode"
|
||||
}
|
||||
|
||||
app.get(url).document.select("div#_default-servers a.server").map {
|
||||
app.get(url, referer = "https://smashystream.com/").document.select("div#_default-servers a.server").map {
|
||||
it.attr("data-id") to it.text()
|
||||
}.apmap {
|
||||
when {
|
||||
|
@ -2249,6 +2249,26 @@ object SoraExtractor : SoraStream() {
|
|||
)
|
||||
}
|
||||
|
||||
suspend fun invokeJmdkhMovies(
|
||||
apiUrl: String,
|
||||
api: String,
|
||||
title: String? = null,
|
||||
year: Int? = null,
|
||||
season: Int? = null,
|
||||
episode: Int? = null,
|
||||
callback: (ExtractorLink) -> Unit,
|
||||
) {
|
||||
invokeIndex(
|
||||
apiUrl,
|
||||
api,
|
||||
title,
|
||||
year,
|
||||
season,
|
||||
episode,
|
||||
callback,
|
||||
)
|
||||
}
|
||||
|
||||
private suspend fun invokeIndex(
|
||||
apiUrl: String,
|
||||
api: String,
|
||||
|
@ -2349,6 +2369,59 @@ object SoraExtractor : SoraStream() {
|
|||
|
||||
}
|
||||
|
||||
suspend fun invokeTgarMovies(
|
||||
title: String? = null,
|
||||
year: Int? = null,
|
||||
season: Int? = null,
|
||||
episode: Int? = null,
|
||||
callback: (ExtractorLink) -> Unit,
|
||||
) {
|
||||
val query = getIndexQuery(title, year, season, episode)
|
||||
val (dotSlug, spaceSlug, slashSlug) = getTitleSlug(title)
|
||||
val (seasonSlug, episodeSlug) = getEpisodeSlug(season, episode)
|
||||
|
||||
val files = app.get(
|
||||
"https://api.telegram.d1.zindex.eu.org/search?name=${encode(query)}&page=1",
|
||||
referer = tgarMovieAPI,
|
||||
).parsedSafe<TgarData>()?.results?.filter { media ->
|
||||
(if (season == null) {
|
||||
media.name?.contains("$year") == true
|
||||
} else {
|
||||
media.name?.contains(Regex("(?i)S${seasonSlug}.?E${episodeSlug}")) == true
|
||||
}) && media.name?.contains(
|
||||
Regex("(?i)(2160p|1080p)")
|
||||
) == true && (media.mime_type in mimeType) && (media.name.replace(
|
||||
"-",
|
||||
"."
|
||||
).contains(
|
||||
"$dotSlug",
|
||||
true
|
||||
) || media.name.replace(
|
||||
"-",
|
||||
" "
|
||||
).contains("$spaceSlug", true) || media.name.replace(
|
||||
"-",
|
||||
"_"
|
||||
).contains("$slashSlug", true))
|
||||
}
|
||||
|
||||
files?.map { file ->
|
||||
val size = "%.2f GB".format(bytesToGigaBytes(file.size?.toDouble() ?: return@map null))
|
||||
val quality = getIndexQuality(file.name)
|
||||
val tags = getIndexQualityTags(file.name)
|
||||
callback.invoke(
|
||||
ExtractorLink(
|
||||
"TgarMovies $tags [$size]",
|
||||
"TgarMovies $tags [$size]",
|
||||
"https://api.southkoreacdn.workers.dev/telegram/${file._id}",
|
||||
"$tgarMovieAPI/",
|
||||
quality,
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
suspend fun invokeDahmerMovies(
|
||||
title: String? = null,
|
||||
year: Int? = null,
|
||||
|
@ -2492,6 +2565,12 @@ class Sblongvu : StreamSB() {
|
|||
override var mainUrl = "https://sblongvu.com"
|
||||
}
|
||||
|
||||
data class TitleSlug(
|
||||
val dotSlug: String? = null,
|
||||
val spaceSlug: String? = null,
|
||||
val slashSlug: String? = null,
|
||||
)
|
||||
|
||||
data class FDMovieIFrame(
|
||||
val link: String,
|
||||
val quality: String,
|
||||
|
@ -2763,4 +2842,16 @@ data class IndexData(
|
|||
|
||||
data class IndexSearch(
|
||||
@JsonProperty("data") val data: IndexData? = null,
|
||||
)
|
||||
|
||||
data class TgarMedia(
|
||||
@JsonProperty("_id") val _id: Int? = null,
|
||||
@JsonProperty("name") val name: String? = null,
|
||||
@JsonProperty("size") val size: String? = null,
|
||||
@JsonProperty("file_unique_id") val file_unique_id: String? = null,
|
||||
@JsonProperty("mime_type") val mime_type: String? = null,
|
||||
)
|
||||
|
||||
data class TgarData(
|
||||
@JsonProperty("results") val results: ArrayList<TgarMedia>? = arrayListOf(),
|
||||
)
|
|
@ -30,6 +30,7 @@ import com.hexated.SoraExtractor.invokeFlixon
|
|||
import com.hexated.SoraExtractor.invokeFwatayako
|
||||
import com.hexated.SoraExtractor.invokeGMovies
|
||||
import com.hexated.SoraExtractor.invokeGomovies
|
||||
import com.hexated.SoraExtractor.invokeJmdkhMovies
|
||||
import com.hexated.SoraExtractor.invokeJsmovies
|
||||
import com.hexated.SoraExtractor.invokeKisskh
|
||||
import com.hexated.SoraExtractor.invokeLing
|
||||
|
@ -43,6 +44,7 @@ import com.hexated.SoraExtractor.invokeRStream
|
|||
import com.hexated.SoraExtractor.invokeRinzrymovies
|
||||
import com.hexated.SoraExtractor.invokeSmashyStream
|
||||
import com.hexated.SoraExtractor.invokeSoraStream
|
||||
import com.hexated.SoraExtractor.invokeTgarMovies
|
||||
import com.hexated.SoraExtractor.invokeTvMovies
|
||||
import com.hexated.SoraExtractor.invokeUhdmovies
|
||||
import com.hexated.SoraExtractor.invokeWatchsomuch
|
||||
|
@ -125,6 +127,8 @@ open class SoraStream : TmdbProvider() {
|
|||
const val papaonMovies1API = "https://m.papaonwork.workers.dev/0:"
|
||||
const val papaonMovies2API = "https://m.papaonwork.workers.dev/1:"
|
||||
const val dahmerMoviesAPI = "https://edytjedhgmdhm.abfhaqrhbnf.workers.dev"
|
||||
const val tgarMovieAPI = "https://tgarchive.eu.org"
|
||||
const val jmdkhMovieAPI = "https://tg.jmdkh.eu.org/0:"
|
||||
|
||||
fun getType(t: String?): TvType {
|
||||
return when (t) {
|
||||
|
@ -149,8 +153,8 @@ open class SoraStream : TmdbProvider() {
|
|||
override val mainPage = mainPageOf(
|
||||
"$tmdbAPI/trending/all/day?api_key=$apiKey®ion=US" to "Trending",
|
||||
"$tmdbAPI/movie/popular?api_key=$apiKey®ion=US" to "Popular Movies",
|
||||
"$tmdbAPI/tv/popular?api_key=$apiKey®ion=US" to "Popular TV Shows",
|
||||
"$tmdbAPI/tv/airing_today?api_key=$apiKey®ion=US" to "Airing Today TV Shows",
|
||||
"$tmdbAPI/tv/popular?api_key=$apiKey®ion=US&with_original_language=en" to "Popular TV Shows",
|
||||
"$tmdbAPI/tv/airing_today?api_key=$apiKey®ion=US&with_original_language=en" to "Airing Today TV Shows",
|
||||
// "$tmdbAPI/tv/on_the_air?api_key=$apiKey®ion=US" to "On The Air TV Shows",
|
||||
"$tmdbAPI/discover/tv?api_key=$apiKey&with_networks=213" to "Netflix",
|
||||
"$tmdbAPI/discover/tv?api_key=$apiKey&with_networks=1024" to "Amazon",
|
||||
|
@ -715,6 +719,20 @@ open class SoraStream : TmdbProvider() {
|
|||
{
|
||||
invokeGomovies(res.title, res.year, res.season, res.episode, callback)
|
||||
},
|
||||
{
|
||||
if (!res.isAnime) invokeTgarMovies(res.title, res.year, res.season, res.episode, callback)
|
||||
},
|
||||
{
|
||||
if (!res.isAnime) invokeJmdkhMovies(
|
||||
jmdkhMovieAPI,
|
||||
"JmdkhMovies",
|
||||
res.title,
|
||||
res.year,
|
||||
res.season,
|
||||
res.episode,
|
||||
callback
|
||||
)
|
||||
},
|
||||
)
|
||||
|
||||
return true
|
||||
|
|
|
@ -24,6 +24,7 @@ import okhttp3.RequestBody.Companion.toRequestBody
|
|||
import org.jsoup.nodes.Document
|
||||
import java.net.URI
|
||||
import java.net.URL
|
||||
import java.net.URLEncoder
|
||||
import java.security.MessageDigest
|
||||
import java.security.SecureRandom
|
||||
import java.util.*
|
||||
|
@ -44,6 +45,7 @@ val encodedIndex = arrayOf(
|
|||
"XtremeMovies",
|
||||
"PapaonMovies[1]",
|
||||
"PapaonMovies[2]",
|
||||
"JmdkhMovies",
|
||||
)
|
||||
|
||||
val lockedIndex = arrayOf(
|
||||
|
@ -52,7 +54,8 @@ val lockedIndex = arrayOf(
|
|||
)
|
||||
|
||||
val mkvIndex = arrayOf(
|
||||
"EdithxMovies"
|
||||
"EdithxMovies",
|
||||
"JmdkhMovies",
|
||||
)
|
||||
|
||||
val untrimmedIndex = arrayOf(
|
||||
|
@ -61,6 +64,12 @@ val untrimmedIndex = arrayOf(
|
|||
"EdithxMovies",
|
||||
)
|
||||
|
||||
val mimeType = arrayOf(
|
||||
"video/x-matroska",
|
||||
"video/mp4",
|
||||
"video/x-msvideo"
|
||||
)
|
||||
|
||||
data class FilmxyCookies(
|
||||
val phpsessid: String? = null,
|
||||
val wLog: String? = null,
|
||||
|
@ -637,8 +646,13 @@ fun getEpisodeSlug(
|
|||
}
|
||||
}
|
||||
|
||||
fun getTitleSlug(title: String? = null): Pair<String?, String?> {
|
||||
return title.createSlug()?.replace("-", ".") to title.createSlug()?.replace("-", " ")
|
||||
fun getTitleSlug(title: String? = null): TitleSlug {
|
||||
val slug = title.createSlug()
|
||||
return TitleSlug(
|
||||
slug?.replace("-", "."),
|
||||
slug?.replace("-", " "),
|
||||
slug?.replace("-", "_"),
|
||||
)
|
||||
}
|
||||
|
||||
fun getIndexQuery(
|
||||
|
@ -663,13 +677,8 @@ fun searchIndex(
|
|||
response: String,
|
||||
isTrimmed: Boolean = true,
|
||||
): List<IndexMedia>? {
|
||||
val (dotSlug, spaceSlug) = getTitleSlug(title)
|
||||
val (dotSlug, spaceSlug, slashSlug) = getTitleSlug(title)
|
||||
val (seasonSlug, episodeSlug) = getEpisodeSlug(season, episode)
|
||||
val mimeType = arrayOf(
|
||||
"video/x-matroska",
|
||||
"video/mp4",
|
||||
"video/x-msvideo"
|
||||
)
|
||||
val files = tryParseJson<IndexSearch>(response)?.data?.files?.filter { media ->
|
||||
(if (season == null) {
|
||||
media.name?.contains("$year") == true
|
||||
|
@ -686,7 +695,10 @@ fun searchIndex(
|
|||
) || media.name.replace(
|
||||
"-",
|
||||
" "
|
||||
).contains("$spaceSlug", true))
|
||||
).contains("$spaceSlug", true) || media.name.replace(
|
||||
"-",
|
||||
"_"
|
||||
).contains("$slashSlug", true))
|
||||
}?.distinctBy { it.name }?.sortedByDescending { it.size?.toLongOrNull() ?: 0 } ?: return null
|
||||
|
||||
return if (isTrimmed) {
|
||||
|
@ -838,6 +850,8 @@ fun getBaseUrl(url: String): String {
|
|||
}
|
||||
}
|
||||
|
||||
fun encode(input: String): String? = URLEncoder.encode(input, "utf-8")
|
||||
|
||||
fun decryptStreamUrl(data: String): String {
|
||||
|
||||
fun getTrash(arr: List<String>, item: Int): List<String> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue