Nodrakorid & Hdmovie2: fix episodes list

This commit is contained in:
sora 2023-08-06 01:59:19 +07:00
parent b04f604e74
commit 5341a03eb6
7 changed files with 20 additions and 25 deletions

View file

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

View file

@ -46,7 +46,9 @@ open class Gomov : MainAPI() {
val posterUrl = fixUrlNull(this.selectFirst("a > img")?.attr("src"))?.fixImageQuality() val posterUrl = fixUrlNull(this.selectFirst("a > img")?.attr("src"))?.fixImageQuality()
val quality = this.select("div.gmr-qual, div.gmr-quality-item > a").text().trim().replace("-", "") val quality = this.select("div.gmr-qual, div.gmr-quality-item > a").text().trim().replace("-", "")
return if (quality.isEmpty()) { return if (quality.isEmpty()) {
val episode = this.select("div.gmr-numbeps > span").text().toIntOrNull() val episode =
Regex("Episode\\s?([0-9]+)").find(title)?.groupValues?.getOrNull(1)?.toIntOrNull()
?: this.select("div.gmr-numbeps > span").text().toIntOrNull()
newAnimeSearchResponse(title, href, TvType.TvSeries) { newAnimeSearchResponse(title, href, TvType.TvSeries) {
this.posterUrl = posterUrl this.posterUrl = posterUrl
addSub(episode) addSub(episode)

View file

@ -35,7 +35,7 @@ class Nodrakorid : DutaMovie() {
ele.ownText().filter { it.isDigit() }.toIntOrNull() to ele.select("a") ele.ownText().filter { it.isDigit() }.toIntOrNull() to ele.select("a")
.map { it.attr("href") to it.text() } .map { it.attr("href") to it.text() }
}.filter { it.first != null } }.filter { it.first != null }
Episode(siblings.toJson(), episode = num.filter { it.isDigit() }.toIntOrNull()) Episode(siblings.toJson(), episode = Regex("Episode\\s?([0-9]+)").find(num)?.groupValues?.getOrNull(1)?.toIntOrNull())
} }
} }
} }

View file

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

View file

@ -118,10 +118,10 @@ open class Movierulzhd : MainAPI() {
document.select("span.date").text().trim() document.select("span.date").text().trim()
)?.groupValues?.get(1).toString().toIntOrNull() )?.groupValues?.get(1).toString().toIntOrNull()
val tvType = if (document.select("ul#section > li:nth-child(1)").text() val tvType = if (document.select("ul#section > li:nth-child(1)").text()
.contains("Episodes") || document.selectFirst("ul#playeroptionsul li span.title") .contains("Episodes") || document.select("ul#playeroptionsul li span.title")
?.text()?.contains( .text().contains(
Regex("Episode\\s+\\d+|EP\\d+|PE\\d+") Regex("Episode\\s+\\d+|EP\\d+|PE\\d+")
) == true )
) TvType.TvSeries else TvType.Movie ) TvType.TvSeries else TvType.Movie
val description = document.select("div.wp-content > p").text().trim() val description = document.select("div.wp-content > p").text().trim()
val trailer = document.selectFirst("div.embed iframe")?.attr("src") val trailer = document.selectFirst("div.embed iframe")?.attr("src")

View file

@ -332,21 +332,14 @@ object SoraExtractor : SoraStream() {
} }
val iframe = app.get(url).document.selectFirst("iframe.Moly")?.attr("data-src") val iframe = app.get(url).document.selectFirst("iframe.Moly")?.attr("data-src")
loadExtractor(iframe ?: return, "$dreamfilmAPI/", subtitleCallback) { link -> loadCustomExtractor(
callback.invoke( null,
ExtractorLink( iframe ?: return,
link.name, "$dreamfilmAPI/",
link.name, subtitleCallback,
link.url, callback,
link.referer, Qualities.P1080.value
Qualities.P1080.value, )
link.isM3u8,
link.headers,
link.extractorData
)
)
}
} }
suspend fun invokeSeries9( suspend fun invokeSeries9(

View file

@ -1154,7 +1154,7 @@ suspend fun tmdbToAnimeId(title: String?, year: Int?, season: String?, type: TvT
} }
suspend fun loadCustomExtractor( suspend fun loadCustomExtractor(
name: String, name: String? = null,
url: String, url: String,
referer: String? = null, referer: String? = null,
subtitleCallback: (SubtitleFile) -> Unit, subtitleCallback: (SubtitleFile) -> Unit,
@ -1164,8 +1164,8 @@ suspend fun loadCustomExtractor(
loadExtractor(url, referer, subtitleCallback) { link -> loadExtractor(url, referer, subtitleCallback) { link ->
callback.invoke( callback.invoke(
ExtractorLink( ExtractorLink(
name, name ?: link.source,
name, name ?: link.name,
link.url, link.url,
link.referer, link.referer,
when { when {