mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
sora: added Dramaday
This commit is contained in:
parent
ad88bb0e9c
commit
3d60b9c792
4 changed files with 99 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
|||
import org.jetbrains.kotlin.konan.properties.Properties
|
||||
|
||||
// use an integer for version numbers
|
||||
version = 157
|
||||
version = 158
|
||||
|
||||
android {
|
||||
defaultConfig {
|
||||
|
|
|
@ -644,6 +644,74 @@ object SoraExtractor : SoraStream() {
|
|||
|
||||
}
|
||||
|
||||
suspend fun invokeDramaday(
|
||||
title: String? = null,
|
||||
year: Int? = null,
|
||||
season: Int? = null,
|
||||
episode: Int? = null,
|
||||
subtitleCallback: (SubtitleFile) -> Unit,
|
||||
callback: (ExtractorLink) -> Unit
|
||||
) {
|
||||
fun String.getQuality(): String? =
|
||||
Regex("""\d{3,4}[pP]""").find(this)?.groupValues?.getOrNull(0)
|
||||
|
||||
fun String.getTag(): String? =
|
||||
Regex("""\d{3,4}[pP]\s*(.*)""").find(this)?.groupValues?.getOrNull(1)
|
||||
|
||||
val slug = title.createSlug()
|
||||
val epsSlug = getEpisodeSlug(season, episode)
|
||||
val url = if (season == null) {
|
||||
"$dramadayAPI/$slug-$year/"
|
||||
} else {
|
||||
"$dramadayAPI/$slug/"
|
||||
}
|
||||
val res = app.get(url).document
|
||||
|
||||
val servers = if (season == null) {
|
||||
val player = res.select("div.tabs__pane p a[href*=https://ouo]").attr("href")
|
||||
val ouo = bypassOuo(player)
|
||||
app.get(ouo ?: return).document.select("article p:matches(\\d{3,4}[pP]) + p:has(a)")
|
||||
.flatMap { ele ->
|
||||
val entry = ele.previousElementSibling()?.text() ?: ""
|
||||
ele.select("a").map {
|
||||
Triple(entry.getQuality(), entry.getTag(), it.attr("href"))
|
||||
}.filter {
|
||||
it.third.startsWith("https://pixeldrain.com") || it.third.startsWith("https://krakenfiles.com")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
val data = res.select("tbody tr:has(td[data-order=${epsSlug.second}])")
|
||||
val qualities =
|
||||
data.select("td:nth-child(2)").attr("data-order").split("<br>").map { it }
|
||||
val iframe = data.select("a[href*=https://ouo]").map { it.attr("href") }
|
||||
qualities.zip(iframe).map {
|
||||
Triple(it.first.getQuality(), it.first.getTag(), it.second)
|
||||
}
|
||||
}
|
||||
|
||||
servers.filter { it.first == "720p" || it.first == "1080p" }.apmap {
|
||||
val server = if (it.third.startsWith("https://ouo")) bypassOuo(it.third) else it.third
|
||||
loadExtractor(server ?: return@apmap, "$dramadayAPI/", subtitleCallback) { link ->
|
||||
callback.invoke(
|
||||
ExtractorLink(
|
||||
link.source,
|
||||
"${link.name} ${it.second}",
|
||||
link.url,
|
||||
link.referer,
|
||||
when {
|
||||
link.isM3u8 -> link.quality
|
||||
else -> getQualityFromName(it.first)
|
||||
},
|
||||
link.isM3u8,
|
||||
link.headers,
|
||||
link.extractorData
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
suspend fun invokeKimcartoon(
|
||||
title: String? = null,
|
||||
season: Int? = null,
|
||||
|
|
|
@ -18,6 +18,7 @@ import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
|
|||
import com.lagradost.cloudstream3.metaproviders.TmdbProvider
|
||||
import com.hexated.SoraExtractor.invokeDahmerMovies
|
||||
import com.hexated.SoraExtractor.invokeDoomovies
|
||||
import com.hexated.SoraExtractor.invokeDramaday
|
||||
import com.hexated.SoraExtractor.invokeDreamfilm
|
||||
import com.hexated.SoraExtractor.invokeFDMovies
|
||||
import com.hexated.SoraExtractor.invokeFlixon
|
||||
|
@ -130,11 +131,13 @@ open class SoraStream : TmdbProvider() {
|
|||
const val doomoviesAPI = "https://doomovies.net"
|
||||
const val primewireAPI = "https://real-primewire.club"
|
||||
const val vidsrctoAPI = "https://vidsrc.to"
|
||||
const val dramadayAPI = "https://dramaday.me"
|
||||
|
||||
// INDEX SITE
|
||||
const val dahmerMoviesAPI = "https://edytjedhgmdhm.abfhaqrhbnf.workers.dev"
|
||||
const val shinobiMovieAPI = "https://home.shinobicloud.cf/0:"
|
||||
val cryMoviesAPI = base64DecodeAPI("ZXY=LmQ=cnM=a2U=b3I=Lnc=ZXI=ZGQ=bGE=cy0=b2I=YWM=Lmo=YWw=aW4=LWY=cm4=Ym8=cmU=Ly8=czo=dHA=aHQ=")
|
||||
val cryMoviesAPI =
|
||||
base64DecodeAPI("ZXY=LmQ=cnM=a2U=b3I=Lnc=ZXI=ZGQ=bGE=cy0=b2I=YWM=Lmo=YWw=aW4=LWY=cm4=Ym8=cmU=Ly8=czo=dHA=aHQ=")
|
||||
|
||||
fun getType(t: String?): TvType {
|
||||
return when (t) {
|
||||
|
@ -244,8 +247,8 @@ open class SoraStream : TmdbProvider() {
|
|||
val year = releaseDate?.split("-")?.first()?.toIntOrNull()
|
||||
val rating = res.vote_average.toString().toRatingInt()
|
||||
val genres = res.genres?.mapNotNull { it.name }
|
||||
val isAnime =
|
||||
genres?.contains("Animation") == true && (res.original_language == "zh" || res.original_language == "ja")
|
||||
val isAnime = genres?.contains("Animation") == true && (res.original_language == "zh" || res.original_language == "ja")
|
||||
val isAsian = !isAnime && (res.original_language == "zh" || res.original_language == "ko")
|
||||
val keywords = res.keywords?.results?.mapNotNull { it.name }.orEmpty()
|
||||
.ifEmpty { res.keywords?.keywords?.mapNotNull { it.name } }
|
||||
|
||||
|
@ -286,6 +289,7 @@ open class SoraStream : TmdbProvider() {
|
|||
jpTitle = res.alternative_titles?.results?.find { it.iso_3166_1 == "JP" }?.title,
|
||||
date = season.airDate,
|
||||
airedDate = res.releaseDate ?: res.firstAirDate,
|
||||
isAsian = isAsian,
|
||||
).toJson(),
|
||||
name = eps.name + if (isUpcoming(eps.airDate)) " - [UPCOMING]" else "",
|
||||
season = eps.seasonNumber,
|
||||
|
@ -332,6 +336,7 @@ open class SoraStream : TmdbProvider() {
|
|||
isAnime = isAnime,
|
||||
jpTitle = res.alternative_titles?.results?.find { it.iso_3166_1 == "JP" }?.title,
|
||||
airedDate = res.releaseDate ?: res.firstAirDate,
|
||||
isAsian = isAsian,
|
||||
).toJson(),
|
||||
) {
|
||||
this.posterUrl = poster
|
||||
|
@ -725,6 +730,16 @@ open class SoraStream : TmdbProvider() {
|
|||
callback
|
||||
)
|
||||
},
|
||||
{
|
||||
if(res.isAsian) invokeDramaday(
|
||||
res.title,
|
||||
res.year,
|
||||
res.season,
|
||||
res.episode,
|
||||
subtitleCallback,
|
||||
callback
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
return true
|
||||
|
@ -748,6 +763,7 @@ open class SoraStream : TmdbProvider() {
|
|||
val jpTitle: String? = null,
|
||||
val date: String? = null,
|
||||
val airedDate: String? = null,
|
||||
val isAsian: Boolean = false,
|
||||
)
|
||||
|
||||
data class Data(
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.hexated.SoraExtractor.invokeAnimes
|
|||
import com.hexated.SoraExtractor.invokeAsk4Movies
|
||||
import com.hexated.SoraExtractor.invokeDbgo
|
||||
import com.hexated.SoraExtractor.invokeDoomovies
|
||||
import com.hexated.SoraExtractor.invokeDramaday
|
||||
import com.hexated.SoraExtractor.invokeDreamfilm
|
||||
import com.hexated.SoraExtractor.invokeFilmxy
|
||||
import com.hexated.SoraExtractor.invokeFlixon
|
||||
|
@ -345,6 +346,16 @@ class SoraStreamLite : SoraStream() {
|
|||
callback
|
||||
)
|
||||
},
|
||||
{
|
||||
if(res.isAsian) invokeDramaday(
|
||||
res.title,
|
||||
res.year,
|
||||
res.season,
|
||||
res.episode,
|
||||
subtitleCallback,
|
||||
callback
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
return true
|
||||
|
|
Loading…
Reference in a new issue