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

View file

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