sora: added DahmerMovies

This commit is contained in:
hexated 2023-02-11 00:52:02 +07:00
parent d099e266cc
commit b4d1b6cb65
3 changed files with 70 additions and 10 deletions

View file

@ -2350,16 +2350,8 @@ object SoraExtractor : SoraStream() {
val size = file.size?.toDouble() ?: return@apmap null
val sizeFile = "%.2f GB".format(bytesToGigaBytes(size))
val quality =
Regex("(\\d{3,4})[pP]").find(
file.name ?: return@apmap null
)?.groupValues?.getOrNull(1)?.toIntOrNull()
?: Qualities.P1080.value
val tags = Regex("\\d{3,4}[pP]\\.?(.*?)\\.(mkv|mp4|avi)").find(
file.name
)?.groupValues?.getOrNull(1)?.replace(".", " ")?.trim()
?: ""
val quality = getIndexQuality(file.name)
val tags = getIndexQualityTags(file.name)
callback.invoke(
ExtractorLink(
@ -2375,6 +2367,55 @@ object SoraExtractor : SoraStream() {
}
suspend fun invokeDahmerMovies(
title: String? = null,
year: Int? = null,
season: Int? = null,
episode: Int? = null,
callback: (ExtractorLink) -> Unit,
) {
val url = if(season == null) {
"$dahmerMoviesAPI/movies/${title?.replace(":", "")} ($year)/"
} else {
"$dahmerMoviesAPI/tvs/${title?.replace(":", " -")}/Season $season/"
}
val request = app.get(url)
if(!request.isSuccessful) return
val paths = request.document.select("tr.file").map {
Triple(
it.select("a").text(),
it.select("a").attr("href"),
it.select("size").text(),
)
}.filter {
if(season == null) {
it.first.contains(Regex("(?i)(1080p|2160p)"))
} else {
val (seasonSlug, episodeSlug) = getEpisodeSlug(season, episode)
it.first.contains(Regex("(?i)S${seasonSlug}E${episodeSlug}"))
}
}.ifEmpty { return }
paths.map {
val quality = getIndexQuality(it.first)
val tags = getIndexQualityTags(it.first)
val size = "%.2f GB".format(bytesToGigaBytes(it.third.toDouble()))
callback.invoke(
ExtractorLink(
"DahmerMovies $tags [$size]",
"DahmerMovies $tags [$size]",
url + it.second,
"",
quality,
)
)
}
}
}
class StreamM4u : XStreamCdn() {

View file

@ -23,6 +23,7 @@ import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
import com.lagradost.cloudstream3.metaproviders.TmdbProvider
import com.hexated.SoraExtractor.invokeCrunchyroll
import com.hexated.SoraExtractor.invokeDahmerMovies
import com.hexated.SoraExtractor.invokeEdithxmovies
import com.hexated.SoraExtractor.invokeFDMovies
import com.hexated.SoraExtractor.invokeFlixon
@ -121,6 +122,7 @@ open class SoraStream : TmdbProvider() {
const val xtremeMoviesAPI = "https://kartik19.xtrememirror0.workers.dev/0:"
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"
fun getType(t: String?): TvType {
return when (t) {
@ -699,6 +701,15 @@ open class SoraStream : TmdbProvider() {
callback
)
},
{
invokeDahmerMovies(
res.title,
res.year,
res.season,
res.episode,
callback
)
},
)
return true

View file

@ -654,6 +654,14 @@ fun getKisskhTitle(str: String?): String? {
return str?.replace(Regex("[^a-zA-Z\\d]"), "-")
}
fun getIndexQualityTags(str: String?): String {
return Regex("\\d{3,4}[pP]\\.?(.*?)\\.(mkv|mp4|avi)").find(str ?: "")?.groupValues?.getOrNull(1)?.replace(".", " ")?.trim() ?: ""
}
fun getIndexQuality(str: String?): Int {
return Regex("(\\d{3,4})[pP]").find(str ?: "")?.groupValues?.getOrNull(1)?.toIntOrNull() ?: Qualities.Unknown.value
}
fun getQuality(str: String): Int {
return when (str) {
"360p" -> Qualities.P240.value