mirror of
https://github.com/recloudstream/cloudstream-extensions-multilingual.git
synced 2024-08-15 03:15:14 +00:00
Add showStatus to NekoSamaProvider
This commit is contained in:
parent
b96461bc37
commit
c4b41d7cc2
1 changed files with 15 additions and 5 deletions
|
@ -186,6 +186,7 @@ class NekosamaProvider : MainAPI() {
|
||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
var title = "" //document.select("div.offset-md-4 >:not(small)").text()
|
var title = "" //document.select("div.offset-md-4 >:not(small)").text()
|
||||||
var dataUrl = ""
|
var dataUrl = ""
|
||||||
|
var link_video = ""
|
||||||
/////////////////////////////////////
|
/////////////////////////////////////
|
||||||
results.forEach { infoEpisode ->
|
results.forEach { infoEpisode ->
|
||||||
val episodeScript = infoEpisode.groupValues[1]
|
val episodeScript = infoEpisode.groupValues[1]
|
||||||
|
@ -198,8 +199,8 @@ class NekosamaProvider : MainAPI() {
|
||||||
val srcScriptlink =
|
val srcScriptlink =
|
||||||
Regex("""\"url\"\:\"([^\"]*)\"""") // remove\
|
Regex("""\"url\"\:\"([^\"]*)\"""") // remove\
|
||||||
val link = srcScriptlink.find(episodeScript)?.groupValues?.get(1)
|
val link = srcScriptlink.find(episodeScript)?.groupValues?.get(1)
|
||||||
var link_video = ""
|
|
||||||
if (link != null) link_video = mainUrl + link.replace("\\", "")
|
if (link != null) link_video = fixUrl(link.replace("\\", ""))
|
||||||
|
|
||||||
val srcScriptposter =
|
val srcScriptposter =
|
||||||
Regex("""\"url_image\"\:\"([^\"]*)\"""") // remove\
|
Regex("""\"url_image\"\:\"([^\"]*)\"""") // remove\
|
||||||
|
@ -220,13 +221,16 @@ class NekosamaProvider : MainAPI() {
|
||||||
)
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
val type =
|
val infosList =
|
||||||
document.selectFirst("div#anime-info-list")?.text()
|
document.selectFirst("div#anime-info-list")?.text()
|
||||||
if (type != null) {
|
val isinfosList =!infosList.isNullOrBlank()
|
||||||
if (type.contains(" movie")) mediaType = TvType.AnimeMovie
|
if (isinfosList) {
|
||||||
|
if (infosList!!.contains("movie")) mediaType = TvType.AnimeMovie
|
||||||
}
|
}
|
||||||
|
|
||||||
val description = document.selectFirst("div.synopsis > p")?.text()
|
val description = document.selectFirst("div.synopsis > p")?.text()
|
||||||
val poster = document.select("div.cover > img").attr("src")
|
val poster = document.select("div.cover > img").attr("src")
|
||||||
|
|
||||||
if (mediaType == TvType.AnimeMovie) {
|
if (mediaType == TvType.AnimeMovie) {
|
||||||
return newMovieLoadResponse(
|
return newMovieLoadResponse(
|
||||||
title,
|
title,
|
||||||
|
@ -239,6 +243,11 @@ class NekosamaProvider : MainAPI() {
|
||||||
}
|
}
|
||||||
} else // an anime
|
} else // an anime
|
||||||
{
|
{
|
||||||
|
val status = when(isinfosList){
|
||||||
|
infosList!!.contains("En cours") -> ShowStatus.Ongoing // En cours
|
||||||
|
infosList!!.contains("Terminé") -> ShowStatus.Completed
|
||||||
|
else -> null
|
||||||
|
}
|
||||||
return newAnimeLoadResponse(
|
return newAnimeLoadResponse(
|
||||||
title,
|
title,
|
||||||
url,
|
url,
|
||||||
|
@ -250,6 +259,7 @@ class NekosamaProvider : MainAPI() {
|
||||||
DubStatus.Dubbed,
|
DubStatus.Dubbed,
|
||||||
episodes
|
episodes
|
||||||
)
|
)
|
||||||
|
this.showStatus=status
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue