sora: added jmdkhMovie

This commit is contained in:
hexated 2023-02-20 02:57:29 +07:00
parent 7a9c41d2ab
commit 9654ff0cbe
4 changed files with 46 additions and 6 deletions

View File

@ -1,5 +1,5 @@
// use an integer for version numbers
version = 92
version = 93
cloudstream {

View File

@ -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,
@ -2361,9 +2381,8 @@ object SoraExtractor : SoraStream() {
val (seasonSlug, episodeSlug) = getEpisodeSlug(season, episode)
val files = app.get(
"https://api.telegram.d1.zindex.eu.org/search?name=$query&page=1",
"https://api.telegram.d1.zindex.eu.org/search?name=${encode(query)}&page=1",
referer = tgarMovieAPI,
timeout = 120L
).parsedSafe<TgarData>()?.results?.filter { media ->
(if (season == null) {
media.name?.contains("$year") == true

View File

@ -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
@ -127,6 +128,7 @@ open class SoraStream : TmdbProvider() {
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) {
@ -720,6 +722,17 @@ open class SoraStream : TmdbProvider() {
{
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

View File

@ -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(
@ -674,7 +677,7 @@ 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 files = tryParseJson<IndexSearch>(response)?.data?.files?.filter { media ->
(if (season == null) {
@ -692,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) {
@ -844,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> {