This commit is contained in:
LagradOst 2022-02-27 01:13:55 +01:00
parent 428e97ab1c
commit f7fcd69a46
2 changed files with 16 additions and 7 deletions

View file

@ -2,6 +2,7 @@ package com.lagradost.cloudstream3.animeproviders
import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.* import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.mvvm.logError
import com.lagradost.cloudstream3.utils.AppUtils.parseJson import com.lagradost.cloudstream3.utils.AppUtils.parseJson
import com.lagradost.cloudstream3.utils.ExtractorLink import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.loadExtractor import com.lagradost.cloudstream3.utils.loadExtractor
@ -257,11 +258,16 @@ class NineAnimeProvider : MainAPI() {
jsonservers.mp4upload, jsonservers.mp4upload,
jsonservers.streamtape jsonservers.streamtape
).mapNotNull { ).mapNotNull {
try {
val epserver = app.get("$mainUrl/ajax/anime/episode?id=$it").text val epserver = app.get("$mainUrl/ajax/anime/episode?id=$it").text
(if (epserver.contains("url")) { (if (epserver.contains("url")) {
parseJson<Links>(epserver) parseJson<Links>(epserver)
} else null)?.url?.let { it1 -> getLink(it1.replace("=", "")) } } else null)?.url?.let { it1 -> getLink(it1.replace("=", "")) }
?.replace("/embed/", "/e/") ?.replace("/embed/", "/e/")
} catch (e : Exception) {
logError(e)
null
}
}.apmap { url -> }.apmap { url ->
loadExtractor( loadExtractor(
url, data, callback url, data, callback

View file

@ -480,6 +480,7 @@ class GeneratorPlayer : FullScreenPlayer() {
@SuppressLint("SetTextI18n") @SuppressLint("SetTextI18n")
fun setTitle() { fun setTitle() {
var headerName: String? = null var headerName: String? = null
var subName : String? = null
var episode: Int? = null var episode: Int? = null
var season: Int? = null var season: Int? = null
var tvType: TvType? = null var tvType: TvType? = null
@ -489,12 +490,14 @@ class GeneratorPlayer : FullScreenPlayer() {
is ResultEpisode -> { is ResultEpisode -> {
isFiller = meta.isFiller isFiller = meta.isFiller
headerName = meta.headerName headerName = meta.headerName
subName = meta.name
episode = meta.episode episode = meta.episode
season = meta.season season = meta.season
tvType = meta.tvType tvType = meta.tvType
} }
is ExtractorUri -> { is ExtractorUri -> {
headerName = meta.headerName headerName = meta.headerName
subName = meta.name
episode = meta.episode episode = meta.episode
season = meta.season season = meta.season
tvType = meta.tvType tvType = meta.tvType
@ -504,13 +507,13 @@ class GeneratorPlayer : FullScreenPlayer() {
player_episode_filler_holder?.isVisible = isFiller ?: false player_episode_filler_holder?.isVisible = isFiller ?: false
player_video_title?.text = if (headerName != null) { player_video_title?.text = if (headerName != null) {
headerName + (headerName +
if (tvType.isEpisodeBased() && episode != null) if (tvType.isEpisodeBased() && episode != null)
if (season == null) if (season == null)
" - ${getString(R.string.episode)} $episode" " - ${getString(R.string.episode)} $episode"
else else
" \"${getString(R.string.season_short)}${season}:${getString(R.string.episode_short)}${episode}\"" " \"${getString(R.string.season_short)}${season}:${getString(R.string.episode_short)}${episode}\""
else "" else "") + if(subName.isNullOrBlank()) "" else " - $subName"
} else { } else {
"" ""
} }