mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
several fix
This commit is contained in:
parent
730556f5de
commit
7f83b0e73e
24 changed files with 479 additions and 372 deletions
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 5
|
||||
version = 6
|
||||
|
||||
|
||||
cloudstream {
|
||||
|
|
|
@ -27,8 +27,6 @@ class AnimeIndoProvider : MainAPI() {
|
|||
)
|
||||
|
||||
companion object {
|
||||
private const val jikanAPI = "https://api.jikan.moe/v4"
|
||||
|
||||
fun getType(t: String): TvType {
|
||||
return if (t.contains("OVA", true) || t.contains("Special")) TvType.OVA
|
||||
else if (t.contains("Movie", true)) TvType.AnimeMovie
|
||||
|
@ -147,13 +145,7 @@ class AnimeIndoProvider : MainAPI() {
|
|||
val status = getStatus(document.selectFirst("div.info-content > div.spe > span:nth-child(1)")!!.ownText().trim())
|
||||
val description = document.select("div[itemprop=description] > p").text()
|
||||
|
||||
val malId = app.get("${jikanAPI}/anime?q=$title&start_date=${year}&type=$type&limit=1")
|
||||
.parsedSafe<JikanResponse>()?.data?.firstOrNull()?.mal_id
|
||||
val anilistId = app.post(
|
||||
"https://graphql.anilist.co/", data = mapOf(
|
||||
"query" to "{Media(idMal:$malId,type:ANIME){id}}",
|
||||
)
|
||||
).parsedSafe<DataAni>()?.data?.media?.id
|
||||
val (malId, anilistId, image, cover) = getTracker(title, type, year)
|
||||
val trailer = document.selectFirst("div.player-embed iframe")?.attr("src")
|
||||
val episodes = document.select("div.lstepsiode.listeps ul li").mapNotNull {
|
||||
val header = it.selectFirst("span.lchx > a") ?: return@mapNotNull null
|
||||
|
@ -164,13 +156,14 @@ class AnimeIndoProvider : MainAPI() {
|
|||
|
||||
return newAnimeLoadResponse(title, url, getType(type)) {
|
||||
engName = title
|
||||
posterUrl = poster
|
||||
posterUrl = image ?: poster
|
||||
backgroundPosterUrl = cover ?: image ?: poster
|
||||
this.year = year
|
||||
addEpisodes(DubStatus.Subbed, episodes)
|
||||
showStatus = status
|
||||
plot = description
|
||||
this.tags = tags
|
||||
addMalId(malId?.toIntOrNull())
|
||||
addMalId(malId)
|
||||
addAniListId(anilistId?.toIntOrNull())
|
||||
addTrailer(trailer)
|
||||
}
|
||||
|
@ -199,24 +192,41 @@ class AnimeIndoProvider : MainAPI() {
|
|||
return true
|
||||
}
|
||||
|
||||
data class Data(
|
||||
@JsonProperty("mal_id") val mal_id: String? = null,
|
||||
private suspend fun getTracker(title: String?, type: String?, year: Int?): Tracker {
|
||||
val res = app.get("https://api.consumet.org/meta/anilist/$title")
|
||||
.parsedSafe<AniSearch>()?.results?.find { media ->
|
||||
(media.title?.english.equals(title, true) || media.title?.romaji.equals(
|
||||
title,
|
||||
true
|
||||
)) || (media.type.equals(type, true) && media.releaseDate == year)
|
||||
}
|
||||
return Tracker(res?.malId, res?.aniId, res?.image, res?.cover)
|
||||
}
|
||||
|
||||
data class Tracker(
|
||||
val malId: Int? = null,
|
||||
val aniId: String? = null,
|
||||
val image: String? = null,
|
||||
val cover: String? = null,
|
||||
)
|
||||
|
||||
data class JikanResponse(
|
||||
@JsonProperty("data") val data: ArrayList<Data>? = arrayListOf(),
|
||||
data class Title(
|
||||
@JsonProperty("romaji") val romaji: String? = null,
|
||||
@JsonProperty("english") val english: String? = null,
|
||||
)
|
||||
|
||||
private data class IdAni(
|
||||
@JsonProperty("id") val id: String? = null,
|
||||
data class Results(
|
||||
@JsonProperty("id") val aniId: String? = null,
|
||||
@JsonProperty("malId") val malId: Int? = null,
|
||||
@JsonProperty("title") val title: Title? = null,
|
||||
@JsonProperty("releaseDate") val releaseDate: Int? = null,
|
||||
@JsonProperty("type") val type: String? = null,
|
||||
@JsonProperty("image") val image: String? = null,
|
||||
@JsonProperty("cover") val cover: String? = null,
|
||||
)
|
||||
|
||||
private data class MediaAni(
|
||||
@JsonProperty("Media") val media: IdAni? = null,
|
||||
)
|
||||
|
||||
private data class DataAni(
|
||||
@JsonProperty("data") val data: MediaAni? = null,
|
||||
data class AniSearch(
|
||||
@JsonProperty("results") val results: ArrayList<Results>? = arrayListOf(),
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 4
|
||||
version = 5
|
||||
|
||||
|
||||
cloudstream {
|
||||
|
|
|
@ -26,8 +26,6 @@ class AnimeSailProvider : MainAPI() {
|
|||
)
|
||||
|
||||
companion object {
|
||||
private const val jikanAPI = "https://api.jikan.moe/v4"
|
||||
|
||||
fun getType(t: String): TvType {
|
||||
return if (t.contains("OVA", true) || t.contains("Special")) TvType.OVA
|
||||
else if (t.contains("Movie", true)) TvType.AnimeMovie
|
||||
|
@ -111,16 +109,11 @@ class AnimeSailProvider : MainAPI() {
|
|||
|
||||
val title = document.selectFirst("h1.entry-title")?.text().toString()
|
||||
.replace("Subtitle Indonesia", "").trim()
|
||||
val poster = document.selectFirst("div.entry-content > img")?.attr("src")
|
||||
val type = document.select("tbody th:contains(Tipe)").next().text().lowercase()
|
||||
val year = document.select("tbody th:contains(Dirilis)").next().text().trim().toIntOrNull()
|
||||
|
||||
val malId = app.get("${jikanAPI}/anime?q=$title&start_date=${year}&type=$type&limit=1")
|
||||
.parsedSafe<JikanResponse>()?.data?.firstOrNull()?.mal_id
|
||||
val anilistId = app.post(
|
||||
"https://graphql.anilist.co/", data = mapOf(
|
||||
"query" to "{Media(idMal:$malId,type:ANIME){id}}",
|
||||
)
|
||||
).parsedSafe<DataAni>()?.data?.media?.id
|
||||
val (malId, anilistId, image, cover) = getTracker(title, type, year)
|
||||
|
||||
val episodes = document.select("ul.daftar > li").map {
|
||||
val episode = Regex("Episode\\s?([0-9]+)").find(
|
||||
|
@ -131,7 +124,8 @@ class AnimeSailProvider : MainAPI() {
|
|||
}.reversed()
|
||||
|
||||
return newAnimeLoadResponse(title, url, getType(type)) {
|
||||
posterUrl = document.selectFirst("div.entry-content > img")?.attr("src")
|
||||
posterUrl = image ?: poster
|
||||
backgroundPosterUrl = cover ?: image ?: poster
|
||||
this.year = year
|
||||
addEpisodes(DubStatus.Subbed, episodes)
|
||||
showStatus =
|
||||
|
@ -139,7 +133,7 @@ class AnimeSailProvider : MainAPI() {
|
|||
plot = document.selectFirst("div.entry-content > p")?.text()
|
||||
this.tags =
|
||||
document.select("tbody th:contains(Genre)").next().select("a").map { it.text() }
|
||||
addMalId(malId?.toIntOrNull())
|
||||
addMalId(malId)
|
||||
addAniListId(anilistId?.toIntOrNull())
|
||||
}
|
||||
}
|
||||
|
@ -208,24 +202,41 @@ class AnimeSailProvider : MainAPI() {
|
|||
return true
|
||||
}
|
||||
|
||||
data class Data(
|
||||
@JsonProperty("mal_id") val mal_id: String? = null,
|
||||
private suspend fun getTracker(title: String?, type: String?, year: Int?): Tracker {
|
||||
val res = app.get("https://api.consumet.org/meta/anilist/$title")
|
||||
.parsedSafe<AniSearch>()?.results?.find { media ->
|
||||
(media.title?.english.equals(title, true) || media.title?.romaji.equals(
|
||||
title,
|
||||
true
|
||||
)) || (media.type.equals(type, true) && media.releaseDate == year)
|
||||
}
|
||||
return Tracker(res?.malId, res?.aniId, res?.image, res?.cover)
|
||||
}
|
||||
|
||||
data class Tracker(
|
||||
val malId: Int? = null,
|
||||
val aniId: String? = null,
|
||||
val image: String? = null,
|
||||
val cover: String? = null,
|
||||
)
|
||||
|
||||
data class JikanResponse(
|
||||
@JsonProperty("data") val data: ArrayList<Data>? = arrayListOf(),
|
||||
data class Title(
|
||||
@JsonProperty("romaji") val romaji: String? = null,
|
||||
@JsonProperty("english") val english: String? = null,
|
||||
)
|
||||
|
||||
private data class IdAni(
|
||||
@JsonProperty("id") val id: String? = null,
|
||||
data class Results(
|
||||
@JsonProperty("id") val aniId: String? = null,
|
||||
@JsonProperty("malId") val malId: Int? = null,
|
||||
@JsonProperty("title") val title: Title? = null,
|
||||
@JsonProperty("releaseDate") val releaseDate: Int? = null,
|
||||
@JsonProperty("type") val type: String? = null,
|
||||
@JsonProperty("image") val image: String? = null,
|
||||
@JsonProperty("cover") val cover: String? = null,
|
||||
)
|
||||
|
||||
private data class MediaAni(
|
||||
@JsonProperty("Media") val media: IdAni? = null,
|
||||
)
|
||||
|
||||
private data class DataAni(
|
||||
@JsonProperty("data") val data: MediaAni? = null,
|
||||
data class AniSearch(
|
||||
@JsonProperty("results") val results: ArrayList<Results>? = arrayListOf(),
|
||||
)
|
||||
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 2
|
||||
version = 3
|
||||
|
||||
|
||||
cloudstream {
|
||||
|
|
|
@ -23,7 +23,6 @@ class Gomunimeis : MainAPI() {
|
|||
)
|
||||
|
||||
companion object {
|
||||
private const val jikanAPI = "https://api.jikan.moe/v4"
|
||||
private const val mainImageUrl = "https://upload.anoboy.live"
|
||||
|
||||
fun getType(t: String): TvType {
|
||||
|
@ -101,15 +100,7 @@ class Gomunimeis : MainAPI() {
|
|||
)?.groupValues?.get(1)?.toIntOrNull()
|
||||
val status = getStatus(document.selectFirst(".spe > span")!!.ownText())
|
||||
val description = document.select("div[itemprop = description] > p").text()
|
||||
|
||||
val malId = app.get("${jikanAPI}/anime?q=$title&start_date=${year}&type=$type&limit=1")
|
||||
.parsedSafe<JikanResponse>()?.data?.firstOrNull()?.mal_id
|
||||
val anilistId = app.post(
|
||||
"https://graphql.anilist.co/", data = mapOf(
|
||||
"query" to "{Media(idMal:$malId,type:ANIME){id}}",
|
||||
)
|
||||
).parsedSafe<DataAni>()?.data?.media?.id
|
||||
|
||||
val (malId, anilistId, image, cover) = getTracker(title, type, year)
|
||||
val episodes = document.select(".eplister > ul > li").map {
|
||||
val episode = Regex("Episode\\s?([0-9]+)").find(
|
||||
it.select(".epl-title").text()
|
||||
|
@ -120,11 +111,12 @@ class Gomunimeis : MainAPI() {
|
|||
|
||||
return newAnimeLoadResponse(title, url, getType(type)) {
|
||||
engName = title
|
||||
posterUrl = poster
|
||||
posterUrl = image ?: poster
|
||||
backgroundPosterUrl = cover ?: image ?: poster
|
||||
this.year = year
|
||||
addEpisodes(DubStatus.Subbed, episodes)
|
||||
showStatus = status
|
||||
addMalId(malId?.toIntOrNull())
|
||||
addMalId(malId)
|
||||
addAniListId(anilistId?.toIntOrNull())
|
||||
plot = description
|
||||
this.tags = tags
|
||||
|
@ -151,6 +143,43 @@ class Gomunimeis : MainAPI() {
|
|||
return true
|
||||
}
|
||||
|
||||
private suspend fun getTracker(title: String?, type: String?, year: Int?): Tracker {
|
||||
val res = app.get("https://api.consumet.org/meta/anilist/$title")
|
||||
.parsedSafe<AniSearch>()?.results?.find { media ->
|
||||
(media.title?.english.equals(title, true) || media.title?.romaji.equals(
|
||||
title,
|
||||
true
|
||||
)) || (media.type.equals(type, true) && media.releaseDate == year)
|
||||
}
|
||||
return Tracker(res?.malId, res?.aniId, res?.image, res?.cover)
|
||||
}
|
||||
|
||||
data class Tracker(
|
||||
val malId: Int? = null,
|
||||
val aniId: String? = null,
|
||||
val image: String? = null,
|
||||
val cover: String? = null,
|
||||
)
|
||||
|
||||
data class Title(
|
||||
@JsonProperty("romaji") val romaji: String? = null,
|
||||
@JsonProperty("english") val english: String? = null,
|
||||
)
|
||||
|
||||
data class Results(
|
||||
@JsonProperty("id") val aniId: String? = null,
|
||||
@JsonProperty("malId") val malId: Int? = null,
|
||||
@JsonProperty("title") val title: Title? = null,
|
||||
@JsonProperty("releaseDate") val releaseDate: Int? = null,
|
||||
@JsonProperty("type") val type: String? = null,
|
||||
@JsonProperty("image") val image: String? = null,
|
||||
@JsonProperty("cover") val cover: String? = null,
|
||||
)
|
||||
|
||||
data class AniSearch(
|
||||
@JsonProperty("results") val results: ArrayList<Results>? = arrayListOf(),
|
||||
)
|
||||
|
||||
data class Streamsb(
|
||||
@JsonProperty("link") val link: String?,
|
||||
)
|
||||
|
@ -175,24 +204,4 @@ class Gomunimeis : MainAPI() {
|
|||
@JsonProperty("salt") val salt: String?,
|
||||
)
|
||||
|
||||
data class Data(
|
||||
@JsonProperty("mal_id") val mal_id: String? = null,
|
||||
)
|
||||
|
||||
data class JikanResponse(
|
||||
@JsonProperty("data") val data: ArrayList<Data>? = arrayListOf(),
|
||||
)
|
||||
|
||||
private data class IdAni(
|
||||
@JsonProperty("id") val id: String? = null,
|
||||
)
|
||||
|
||||
private data class MediaAni(
|
||||
@JsonProperty("Media") val media: IdAni? = null,
|
||||
)
|
||||
|
||||
private data class DataAni(
|
||||
@JsonProperty("data") val data: MediaAni? = null,
|
||||
)
|
||||
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 6
|
||||
version = 7
|
||||
|
||||
|
||||
cloudstream {
|
||||
|
|
|
@ -5,12 +5,12 @@ import com.lagradost.cloudstream3.*
|
|||
import com.lagradost.cloudstream3.LoadResponse.Companion.addAniListId
|
||||
import com.lagradost.cloudstream3.LoadResponse.Companion.addMalId
|
||||
import com.lagradost.cloudstream3.mvvm.safeApiCall
|
||||
import com.lagradost.cloudstream3.mvvm.suspendSafeApiCall
|
||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||
import com.lagradost.cloudstream3.utils.Qualities
|
||||
import com.lagradost.cloudstream3.utils.loadExtractor
|
||||
import org.jsoup.Jsoup
|
||||
import org.jsoup.nodes.Element
|
||||
import java.util.ArrayList
|
||||
|
||||
class KuramanimeProvider : MainAPI() {
|
||||
override var mainUrl = "https://kuramanime.net"
|
||||
|
@ -27,8 +27,6 @@ class KuramanimeProvider : MainAPI() {
|
|||
)
|
||||
|
||||
companion object {
|
||||
private const val jikanAPI = "https://api.jikan.moe/v4"
|
||||
|
||||
fun getType(t: String): TvType {
|
||||
return if (t.contains("OVA", true) || t.contains("Special")) TvType.OVA
|
||||
else if (t.contains("Movie", true)) TvType.AnimeMovie
|
||||
|
@ -76,9 +74,9 @@ class KuramanimeProvider : MainAPI() {
|
|||
val href = getProperAnimeLink(fixUrl(this.selectFirst("a")!!.attr("href")))
|
||||
val title = this.selectFirst("h5 a")?.text() ?: return null
|
||||
val posterUrl = fixUrl(this.select("div.product__item__pic.set-bg").attr("data-setbg"))
|
||||
val episode = Regex("([0-9*])\\s?/").find(
|
||||
this.select("div.ep span").text()
|
||||
)?.groupValues?.getOrNull(1)?.toIntOrNull()
|
||||
val episode = this.select("div.ep span").text().let {
|
||||
Regex("Ep\\s([0-9]+)\\s/").find(it)?.groupValues?.getOrNull(1)?.toIntOrNull()
|
||||
}
|
||||
|
||||
return newAnimeSearchResponse(title, href, TvType.Anime) {
|
||||
this.posterUrl = posterUrl
|
||||
|
@ -114,14 +112,7 @@ class KuramanimeProvider : MainAPI() {
|
|||
)
|
||||
val type = document.selectFirst("div.col-lg-6.col-md-6 ul li:contains(Tipe:) a")?.text()?.lowercase() ?: "tv"
|
||||
val description = document.select(".anime__details__text > p").text().trim()
|
||||
|
||||
val malId = app.get("${jikanAPI}/anime?q=$title&start_date=${year}&type=$type&limit=1")
|
||||
.parsedSafe<JikanResponse>()?.data?.firstOrNull()?.mal_id
|
||||
val anilistId = app.post(
|
||||
"https://graphql.anilist.co/", data = mapOf(
|
||||
"query" to "{Media(idMal:$malId,type:ANIME){id}}",
|
||||
)
|
||||
).parsedSafe<DataAni>()?.data?.media?.id
|
||||
val (malId, anilistId, image, cover) = getTracker(title, type, year)
|
||||
|
||||
val episodes = mutableListOf<Episode>()
|
||||
|
||||
|
@ -148,12 +139,13 @@ class KuramanimeProvider : MainAPI() {
|
|||
|
||||
return newAnimeLoadResponse(title, url, getType(type)) {
|
||||
engName = title
|
||||
posterUrl = poster
|
||||
posterUrl = image ?: poster
|
||||
backgroundPosterUrl = cover ?: image ?: poster
|
||||
this.year = year
|
||||
addEpisodes(DubStatus.Subbed, episodes)
|
||||
showStatus = status
|
||||
plot = description
|
||||
addMalId(malId?.toIntOrNull())
|
||||
addMalId(malId)
|
||||
addAniListId(anilistId?.toIntOrNull())
|
||||
this.tags = tags
|
||||
this.recommendations = recommendations
|
||||
|
@ -217,24 +209,41 @@ class KuramanimeProvider : MainAPI() {
|
|||
return true
|
||||
}
|
||||
|
||||
data class Data(
|
||||
@JsonProperty("mal_id") val mal_id: String? = null,
|
||||
private suspend fun getTracker(title: String?, type: String?, year: Int?): Tracker {
|
||||
val res = app.get("https://api.consumet.org/meta/anilist/$title")
|
||||
.parsedSafe<AniSearch>()?.results?.find { media ->
|
||||
(media.title?.english.equals(title, true) || media.title?.romaji.equals(
|
||||
title,
|
||||
true
|
||||
)) || (media.type.equals(type, true) && media.releaseDate == year)
|
||||
}
|
||||
return Tracker(res?.malId, res?.aniId, res?.image, res?.cover)
|
||||
}
|
||||
|
||||
data class Tracker(
|
||||
val malId: Int? = null,
|
||||
val aniId: String? = null,
|
||||
val image: String? = null,
|
||||
val cover: String? = null,
|
||||
)
|
||||
|
||||
data class JikanResponse(
|
||||
@JsonProperty("data") val data: ArrayList<Data>? = arrayListOf(),
|
||||
data class Title(
|
||||
@JsonProperty("romaji") val romaji: String? = null,
|
||||
@JsonProperty("english") val english: String? = null,
|
||||
)
|
||||
|
||||
private data class IdAni(
|
||||
@JsonProperty("id") val id: String? = null,
|
||||
data class Results(
|
||||
@JsonProperty("id") val aniId: String? = null,
|
||||
@JsonProperty("malId") val malId: Int? = null,
|
||||
@JsonProperty("title") val title: Title? = null,
|
||||
@JsonProperty("releaseDate") val releaseDate: Int? = null,
|
||||
@JsonProperty("type") val type: String? = null,
|
||||
@JsonProperty("image") val image: String? = null,
|
||||
@JsonProperty("cover") val cover: String? = null,
|
||||
)
|
||||
|
||||
private data class MediaAni(
|
||||
@JsonProperty("Media") val media: IdAni? = null,
|
||||
)
|
||||
|
||||
private data class DataAni(
|
||||
@JsonProperty("data") val data: MediaAni? = null,
|
||||
data class AniSearch(
|
||||
@JsonProperty("results") val results: ArrayList<Results>? = arrayListOf(),
|
||||
)
|
||||
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 3
|
||||
version = 4
|
||||
|
||||
|
||||
cloudstream {
|
||||
|
|
|
@ -11,6 +11,7 @@ import com.lagradost.cloudstream3.utils.getQualityFromName
|
|||
import com.lagradost.cloudstream3.utils.loadExtractor
|
||||
import org.jsoup.Jsoup
|
||||
import org.jsoup.nodes.Element
|
||||
import java.util.ArrayList
|
||||
|
||||
class KuronimeProvider : MainAPI() {
|
||||
override var mainUrl = "https://45.12.2.2"
|
||||
|
@ -27,8 +28,6 @@ class KuronimeProvider : MainAPI() {
|
|||
)
|
||||
|
||||
companion object {
|
||||
private const val jikanAPI = "https://api.jikan.moe/v4"
|
||||
|
||||
fun getType(t: String): TvType {
|
||||
return if (t.contains("OVA", true) || t.contains("Special", true)) TvType.OVA
|
||||
else if (t.contains("Movie", true)) TvType.AnimeMovie
|
||||
|
@ -120,13 +119,7 @@ class KuronimeProvider : MainAPI() {
|
|||
val year = Regex("\\d, ([0-9]*)").find(
|
||||
document.select(".infodetail > ul > li:nth-child(5)").text()
|
||||
)?.groupValues?.get(1)?.toIntOrNull()
|
||||
val malId = app.get("$jikanAPI/anime?q=$title&start_date=${year}&type=$type&limit=1")
|
||||
.parsedSafe<JikanResponse>()?.data?.firstOrNull()?.mal_id
|
||||
val anilistId = app.post(
|
||||
"https://graphql.anilist.co/", data = mapOf(
|
||||
"query" to "{Media(idMal:$malId,type:ANIME){id}}",
|
||||
)
|
||||
).parsedSafe<DataAni>()?.data?.media?.id
|
||||
val (malId, anilistId, image, cover) = getTracker(title, type, year)
|
||||
val status = getStatus(
|
||||
document.selectFirst(".infodetail > ul > li:nth-child(3)")!!.ownText()
|
||||
.replace(Regex("\\W"), "")
|
||||
|
@ -141,12 +134,13 @@ class KuronimeProvider : MainAPI() {
|
|||
|
||||
return newAnimeLoadResponse(title, url, getType(type)) {
|
||||
engName = title
|
||||
posterUrl = poster
|
||||
posterUrl = image ?: poster
|
||||
backgroundPosterUrl = cover ?: image ?: poster
|
||||
this.year = year
|
||||
addEpisodes(DubStatus.Subbed, episodes)
|
||||
showStatus = status
|
||||
plot = description
|
||||
addMalId(malId?.toIntOrNull())
|
||||
addMalId(malId)
|
||||
addAniListId(anilistId?.toIntOrNull())
|
||||
addTrailer(trailer)
|
||||
this.tags = tags
|
||||
|
@ -206,24 +200,41 @@ class KuronimeProvider : MainAPI() {
|
|||
return true
|
||||
}
|
||||
|
||||
data class Data(
|
||||
@JsonProperty("mal_id") val mal_id: String? = null,
|
||||
private suspend fun getTracker(title: String?, type: String?, year: Int?): Tracker {
|
||||
val res = app.get("https://api.consumet.org/meta/anilist/$title")
|
||||
.parsedSafe<AniSearch>()?.results?.find { media ->
|
||||
(media.title?.english.equals(title, true) || media.title?.romaji.equals(
|
||||
title,
|
||||
true
|
||||
)) || (media.type.equals(type, true) && media.releaseDate == year)
|
||||
}
|
||||
return Tracker(res?.malId, res?.aniId, res?.image, res?.cover)
|
||||
}
|
||||
|
||||
data class Tracker(
|
||||
val malId: Int? = null,
|
||||
val aniId: String? = null,
|
||||
val image: String? = null,
|
||||
val cover: String? = null,
|
||||
)
|
||||
|
||||
data class JikanResponse(
|
||||
@JsonProperty("data") val data: ArrayList<Data>? = arrayListOf(),
|
||||
data class Title(
|
||||
@JsonProperty("romaji") val romaji: String? = null,
|
||||
@JsonProperty("english") val english: String? = null,
|
||||
)
|
||||
|
||||
private data class IdAni(
|
||||
@JsonProperty("id") val id: String? = null,
|
||||
data class Results(
|
||||
@JsonProperty("id") val aniId: String? = null,
|
||||
@JsonProperty("malId") val malId: Int? = null,
|
||||
@JsonProperty("title") val title: Title? = null,
|
||||
@JsonProperty("releaseDate") val releaseDate: Int? = null,
|
||||
@JsonProperty("type") val type: String? = null,
|
||||
@JsonProperty("image") val image: String? = null,
|
||||
@JsonProperty("cover") val cover: String? = null,
|
||||
)
|
||||
|
||||
private data class MediaAni(
|
||||
@JsonProperty("Media") val media: IdAni? = null,
|
||||
)
|
||||
|
||||
private data class DataAni(
|
||||
@JsonProperty("data") val data: MediaAni? = null,
|
||||
data class AniSearch(
|
||||
@JsonProperty("results") val results: ArrayList<Results>? = arrayListOf(),
|
||||
)
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 13
|
||||
version = 14
|
||||
|
||||
|
||||
cloudstream {
|
||||
|
|
|
@ -37,7 +37,6 @@ class Loklok : MainAPI() {
|
|||
private val api = base64DecodeAPI("dg==LnQ=b2s=a2w=bG8=aS4=YXA=ZS0=aWw=b2I=LW0=Z2E=Ly8=czo=dHA=aHQ=")
|
||||
private val apiUrl = "$api/${base64Decode("Y21zL2FwcA==")}"
|
||||
private val searchApi = base64Decode("aHR0cHM6Ly9sb2tsb2suY29t")
|
||||
private const val jikanAPI = "https://api.jikan.moe/v4"
|
||||
private const val mainImageUrl = "https://images.weserv.nl"
|
||||
|
||||
private fun base64DecodeAPI(api: String): String {
|
||||
|
@ -175,22 +174,11 @@ class Loklok : MainAPI() {
|
|||
}
|
||||
|
||||
val animeType = if(type == TvType.Anime && data.category == 0) "movie" else "tv"
|
||||
|
||||
val malId = if(type == TvType.Anime) {
|
||||
app.get("${jikanAPI}/anime?q=${res.name}&start_date=${res.year}&type=$animeType&limit=1")
|
||||
.parsedSafe<JikanResponse>()?.data?.firstOrNull()?.mal_id
|
||||
} else {
|
||||
null
|
||||
}
|
||||
val anilistId = if(malId != null) {
|
||||
app.post(
|
||||
"https://graphql.anilist.co/", data = mapOf(
|
||||
"query" to "{Media(idMal:$malId,type:ANIME){id}}",
|
||||
)
|
||||
).parsedSafe<DataAni>()?.data?.media?.id
|
||||
} else {
|
||||
null
|
||||
}
|
||||
val (malId, anilistId) = if (type == TvType.Anime) getTracker(
|
||||
res.name,
|
||||
animeType,
|
||||
res.year
|
||||
) else Tracker()
|
||||
|
||||
return newTvSeriesLoadResponse(
|
||||
res.name ?: return null,
|
||||
|
@ -204,7 +192,7 @@ class Loklok : MainAPI() {
|
|||
this.plot = res.introduction
|
||||
this.tags = res.tagNameList
|
||||
this.rating = res.score.toRatingInt()
|
||||
addMalId(malId?.toIntOrNull())
|
||||
addMalId(malId)
|
||||
addAniListId(anilistId?.toIntOrNull())
|
||||
this.recommendations = recommendations
|
||||
}
|
||||
|
@ -271,6 +259,24 @@ class Loklok : MainAPI() {
|
|||
}
|
||||
}
|
||||
|
||||
private suspend fun getTracker(title: String?, type: String?, year: Int?): Tracker {
|
||||
val res = app.get("https://api.consumet.org/meta/anilist/$title")
|
||||
.parsedSafe<AniSearch>()?.results?.find { media ->
|
||||
(media.title?.english.equals(title, true) || media.title?.romaji.equals(
|
||||
title,
|
||||
true
|
||||
)) || (media.type.equals(type, true) && media.releaseDate == year)
|
||||
}
|
||||
return Tracker(res?.malId, res?.aniId, res?.image, res?.cover)
|
||||
}
|
||||
|
||||
data class Tracker(
|
||||
val malId: Int? = null,
|
||||
val aniId: String? = null,
|
||||
val image: String? = null,
|
||||
val cover: String? = null,
|
||||
)
|
||||
|
||||
data class UrlData(
|
||||
val id: Any? = null,
|
||||
val category: Int? = null,
|
||||
|
@ -295,6 +301,25 @@ class Loklok : MainAPI() {
|
|||
val subtitlingList: List<Subtitling>? = arrayListOf(),
|
||||
)
|
||||
|
||||
data class Title(
|
||||
@JsonProperty("romaji") val romaji: String? = null,
|
||||
@JsonProperty("english") val english: String? = null,
|
||||
)
|
||||
|
||||
data class Results(
|
||||
@JsonProperty("id") val aniId: String? = null,
|
||||
@JsonProperty("malId") val malId: Int? = null,
|
||||
@JsonProperty("title") val title: Title? = null,
|
||||
@JsonProperty("releaseDate") val releaseDate: Int? = null,
|
||||
@JsonProperty("type") val type: String? = null,
|
||||
@JsonProperty("image") val image: String? = null,
|
||||
@JsonProperty("cover") val cover: String? = null,
|
||||
)
|
||||
|
||||
data class AniSearch(
|
||||
@JsonProperty("results") val results: java.util.ArrayList<Results>? = arrayListOf(),
|
||||
)
|
||||
|
||||
data class QuickSearchData(
|
||||
@JsonProperty("searchResults") val searchResults: ArrayList<Media>? = arrayListOf(),
|
||||
)
|
||||
|
@ -378,25 +403,5 @@ class Loklok : MainAPI() {
|
|||
@JsonProperty("data") val data: Data? = null,
|
||||
)
|
||||
|
||||
data class DataMal(
|
||||
@JsonProperty("mal_id") val mal_id: String? = null,
|
||||
)
|
||||
|
||||
data class JikanResponse(
|
||||
@JsonProperty("data") val data: ArrayList<DataMal>? = arrayListOf(),
|
||||
)
|
||||
|
||||
private data class IdAni(
|
||||
@JsonProperty("id") val id: String? = null,
|
||||
)
|
||||
|
||||
private data class MediaAni(
|
||||
@JsonProperty("Media") val media: IdAni? = null,
|
||||
)
|
||||
|
||||
private data class DataAni(
|
||||
@JsonProperty("data") val data: MediaAni? = null,
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 3
|
||||
version = 4
|
||||
|
||||
|
||||
cloudstream {
|
||||
|
|
|
@ -25,8 +25,6 @@ class NeonimeProvider : MainAPI() {
|
|||
)
|
||||
|
||||
companion object {
|
||||
private const val jikanAPI = "https://api.jikan.moe/v4"
|
||||
|
||||
fun getType(t: String): TvType {
|
||||
return if (t.contains("OVA", true) || t.contains("Special", true)) TvType.OVA
|
||||
else if (t.contains("Movie", true)) TvType.AnimeMovie
|
||||
|
@ -122,27 +120,28 @@ class NeonimeProvider : MainAPI() {
|
|||
|
||||
if (url.contains("movie") || url.contains("live-action")) {
|
||||
val mTitle = document.selectFirst(".sbox > .data > h1[itemprop = name]")?.text().toString().replace("Subtitle Indonesia", "").trim()
|
||||
val mPoster = document.selectFirst(".sbox > .imagen > .fix > img[itemprop = image]")?.attr("data-src")
|
||||
val mTrailer = document.selectFirst("div.youtube_id iframe")?.attr("data-wpfc-original-src")?.substringAfterLast("html#")?.let{ "https://www.youtube.com/embed/$it"}
|
||||
val year = document.selectFirst("a[href*=release-year]")!!.text().toIntOrNull()
|
||||
val malId = getMalId(mTitle, year, "movie")
|
||||
val anilistId = getAniId(malId)
|
||||
val (malId, anilistId, image, cover) = getTracker(mTitle, "movie", year)
|
||||
return newMovieLoadResponse(name = mTitle, url = url, type = TvType.Movie, dataUrl = url) {
|
||||
posterUrl = document.selectFirst(".sbox > .imagen > .fix > img[itemprop = image]")?.attr("data-src")
|
||||
posterUrl = image ?: mPoster
|
||||
backgroundPosterUrl = cover ?: image ?: mPoster
|
||||
this.year = year
|
||||
plot = document.select("div[itemprop = description]").text().trim()
|
||||
rating = document.select("span[itemprop = ratingValue]").text().toIntOrNull()
|
||||
tags = document.select("p.meta_dd > a").map { it.text() }
|
||||
addTrailer(mTrailer)
|
||||
addMalId(malId?.toIntOrNull())
|
||||
addMalId(malId)
|
||||
addAniListId(anilistId?.toIntOrNull())
|
||||
}
|
||||
}
|
||||
else {
|
||||
val title = document.select("h1[itemprop = name]").text().replace("Subtitle Indonesia", "").trim()
|
||||
val poster = document.selectFirst(".imagen > img")?.attr("data-src")
|
||||
val trailer = document.selectFirst("div.youtube_id_tv iframe")?.attr("data-wpfc-original-src")?.substringAfterLast("html#")?.let{ "https://www.youtube.com/embed/$it"}
|
||||
val year = document.select("#info a[href*=\"-year/\"]").text().toIntOrNull()
|
||||
val malId = getMalId(title, year, "tv")
|
||||
val anilistId = getAniId(malId)
|
||||
val (malId, anilistId, image, cover) = getTracker(title, "tv", year)
|
||||
val episodes = document.select("ul.episodios > li").mapNotNull {
|
||||
val header = it.selectFirst(".episodiotitle > a")?.ownText().toString()
|
||||
val name = Regex("(Episode\\s?[0-9]+)").find(header)?.groupValues?.getOrNull(0) ?: header
|
||||
|
@ -152,32 +151,20 @@ class NeonimeProvider : MainAPI() {
|
|||
|
||||
return newAnimeLoadResponse(title, url, TvType.Anime) {
|
||||
engName = title
|
||||
posterUrl = document.selectFirst(".imagen > img")?.attr("data-src")
|
||||
posterUrl = image ?: poster
|
||||
backgroundPosterUrl = cover ?: image ?: poster
|
||||
this.year = year
|
||||
addEpisodes(DubStatus.Subbed, episodes)
|
||||
showStatus = getStatus(document.select("div.metadatac > span").last()!!.text().trim())
|
||||
plot = document.select("div[itemprop = description] > p").text().trim()
|
||||
tags = document.select("#info a[href*=\"-genre/\"]").map { it.text() }
|
||||
addTrailer(trailer)
|
||||
addMalId(malId?.toIntOrNull())
|
||||
addMalId(malId)
|
||||
addAniListId(anilistId?.toIntOrNull())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun getAniId(malId: String?) : String? {
|
||||
return app.post(
|
||||
"https://graphql.anilist.co/", data = mapOf(
|
||||
"query" to "{Media(idMal:$malId,type:ANIME){id}}",
|
||||
)
|
||||
).parsedSafe<DataAni>()?.data?.media?.id
|
||||
}
|
||||
|
||||
private suspend fun getMalId(title: String?, year: Int?, type: String?) : String? {
|
||||
return app.get("${jikanAPI}/anime?q=$title&start_date=${year}&type=$type&limit=1")
|
||||
.parsedSafe<JikanResponse>()?.data?.firstOrNull()?.mal_id
|
||||
}
|
||||
|
||||
override suspend fun loadLinks(
|
||||
data: String,
|
||||
isCasting: Boolean,
|
||||
|
@ -201,24 +188,41 @@ class NeonimeProvider : MainAPI() {
|
|||
return true
|
||||
}
|
||||
|
||||
data class Data(
|
||||
@JsonProperty("mal_id") val mal_id: String? = null,
|
||||
private suspend fun getTracker(title: String?, type: String?, year: Int?): Tracker {
|
||||
val res = app.get("https://api.consumet.org/meta/anilist/$title")
|
||||
.parsedSafe<AniSearch>()?.results?.find { media ->
|
||||
(media.title?.english.equals(title, true) || media.title?.romaji.equals(
|
||||
title,
|
||||
true
|
||||
)) || (media.type.equals(type, true) && media.releaseDate == year)
|
||||
}
|
||||
return Tracker(res?.malId, res?.aniId, res?.image, res?.cover)
|
||||
}
|
||||
|
||||
data class Tracker(
|
||||
val malId: Int? = null,
|
||||
val aniId: String? = null,
|
||||
val image: String? = null,
|
||||
val cover: String? = null,
|
||||
)
|
||||
|
||||
data class JikanResponse(
|
||||
@JsonProperty("data") val data: ArrayList<Data>? = arrayListOf(),
|
||||
data class Title(
|
||||
@JsonProperty("romaji") val romaji: String? = null,
|
||||
@JsonProperty("english") val english: String? = null,
|
||||
)
|
||||
|
||||
private data class IdAni(
|
||||
@JsonProperty("id") val id: String? = null,
|
||||
data class Results(
|
||||
@JsonProperty("id") val aniId: String? = null,
|
||||
@JsonProperty("malId") val malId: Int? = null,
|
||||
@JsonProperty("title") val title: Title? = null,
|
||||
@JsonProperty("releaseDate") val releaseDate: Int? = null,
|
||||
@JsonProperty("type") val type: String? = null,
|
||||
@JsonProperty("image") val image: String? = null,
|
||||
@JsonProperty("cover") val cover: String? = null,
|
||||
)
|
||||
|
||||
private data class MediaAni(
|
||||
@JsonProperty("Media") val media: IdAni? = null,
|
||||
)
|
||||
|
||||
private data class DataAni(
|
||||
@JsonProperty("data") val data: MediaAni? = null,
|
||||
data class AniSearch(
|
||||
@JsonProperty("results") val results: ArrayList<Results>? = arrayListOf(),
|
||||
)
|
||||
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 8
|
||||
version = 9
|
||||
|
||||
|
||||
cloudstream {
|
||||
|
|
|
@ -25,8 +25,6 @@ class NontonAnimeIDProvider : MainAPI() {
|
|||
)
|
||||
|
||||
companion object {
|
||||
private const val jikanAPI = "https://api.jikan.moe/v4"
|
||||
|
||||
fun getType(t: String): TvType {
|
||||
return when {
|
||||
t.contains("TV",true) -> TvType.Anime
|
||||
|
@ -135,13 +133,7 @@ class NontonAnimeIDProvider : MainAPI() {
|
|||
val description = document.select(".entry-content.seriesdesc > p").text().trim()
|
||||
val trailer = document.selectFirst("a.trailerbutton")?.attr("href")
|
||||
|
||||
val malId = app.get("${jikanAPI}/anime?q=$title&start_date=${year}&type=$type&limit=1")
|
||||
.parsedSafe<JikanResponse>()?.data?.firstOrNull()?.mal_id
|
||||
val anilistId = app.post(
|
||||
"https://graphql.anilist.co/", data = mapOf(
|
||||
"query" to "{Media(idMal:$malId,type:ANIME){id}}",
|
||||
)
|
||||
).parsedSafe<DataAni>()?.data?.media?.id
|
||||
val (malId, anilistId, image, cover) = getTracker(title, type, year)
|
||||
|
||||
val episodes = if (document.select("button.buttfilter").isNotEmpty()) {
|
||||
val id = document.select("input[name=series_id]").attr("value")
|
||||
|
@ -189,13 +181,14 @@ class NontonAnimeIDProvider : MainAPI() {
|
|||
|
||||
return newAnimeLoadResponse(title, url, getType(type)) {
|
||||
engName = title
|
||||
posterUrl = poster
|
||||
posterUrl = image ?: poster
|
||||
backgroundPosterUrl = cover ?: image ?: poster
|
||||
this.year = year
|
||||
addEpisodes(DubStatus.Subbed, episodes)
|
||||
showStatus = status
|
||||
this.rating = rating
|
||||
plot = description
|
||||
addMalId(malId?.toIntOrNull())
|
||||
addMalId(malId)
|
||||
addAniListId(anilistId?.toIntOrNull())
|
||||
addTrailer(trailer)
|
||||
this.tags = tags
|
||||
|
@ -241,6 +234,43 @@ class NontonAnimeIDProvider : MainAPI() {
|
|||
return true
|
||||
}
|
||||
|
||||
private suspend fun getTracker(title: String?, type: String?, year: Int?): Tracker {
|
||||
val res = app.get("https://api.consumet.org/meta/anilist/$title")
|
||||
.parsedSafe<AniSearch>()?.results?.find { media ->
|
||||
(media.title?.english.equals(title, true) || media.title?.romaji.equals(
|
||||
title,
|
||||
true
|
||||
)) || (media.type.equals(type, true) && media.releaseDate == year)
|
||||
}
|
||||
return Tracker(res?.malId, res?.aniId, res?.image, res?.cover)
|
||||
}
|
||||
|
||||
data class Tracker(
|
||||
val malId: Int? = null,
|
||||
val aniId: String? = null,
|
||||
val image: String? = null,
|
||||
val cover: String? = null,
|
||||
)
|
||||
|
||||
data class Title(
|
||||
@JsonProperty("romaji") val romaji: String? = null,
|
||||
@JsonProperty("english") val english: String? = null,
|
||||
)
|
||||
|
||||
data class Results(
|
||||
@JsonProperty("id") val aniId: String? = null,
|
||||
@JsonProperty("malId") val malId: Int? = null,
|
||||
@JsonProperty("title") val title: Title? = null,
|
||||
@JsonProperty("releaseDate") val releaseDate: Int? = null,
|
||||
@JsonProperty("type") val type: String? = null,
|
||||
@JsonProperty("image") val image: String? = null,
|
||||
@JsonProperty("cover") val cover: String? = null,
|
||||
)
|
||||
|
||||
data class AniSearch(
|
||||
@JsonProperty("results") val results: java.util.ArrayList<Results>? = arrayListOf(),
|
||||
)
|
||||
|
||||
private data class EpResponse(
|
||||
@JsonProperty("posts") val posts: String?,
|
||||
@JsonProperty("max_page") val max_page: Int?,
|
||||
|
@ -248,23 +278,4 @@ class NontonAnimeIDProvider : MainAPI() {
|
|||
@JsonProperty("content") val content: String
|
||||
)
|
||||
|
||||
data class Data(
|
||||
@JsonProperty("mal_id") val mal_id: String? = null,
|
||||
)
|
||||
|
||||
data class JikanResponse(
|
||||
@JsonProperty("data") val data: ArrayList<Data>? = arrayListOf(),
|
||||
)
|
||||
|
||||
private data class IdAni(
|
||||
@JsonProperty("id") val id: String? = null,
|
||||
)
|
||||
|
||||
private data class MediaAni(
|
||||
@JsonProperty("Media") val media: IdAni? = null,
|
||||
)
|
||||
|
||||
private data class DataAni(
|
||||
@JsonProperty("data") val data: MediaAni? = null,
|
||||
)
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 4
|
||||
version = 5
|
||||
|
||||
|
||||
cloudstream {
|
||||
|
|
|
@ -25,8 +25,6 @@ class OploverzProvider : MainAPI() {
|
|||
)
|
||||
|
||||
companion object {
|
||||
private const val jikanAPI = "https://api.jikan.moe/v4"
|
||||
|
||||
fun getType(t: String): TvType {
|
||||
return when {
|
||||
t.contains("TV") -> TvType.Anime
|
||||
|
@ -146,13 +144,7 @@ class OploverzProvider : MainAPI() {
|
|||
val description = document.select(".entry-content > p").text().trim()
|
||||
val trailer = document.selectFirst("a.trailerbutton")?.attr("href")
|
||||
|
||||
val malId = app.get("${jikanAPI}/anime?q=$title&start_date=${year}&${typeCheck.lowercase()}&limit=1")
|
||||
.parsedSafe<JikanResponse>()?.data?.firstOrNull()?.mal_id
|
||||
val anilistId = app.post(
|
||||
"https://graphql.anilist.co/", data = mapOf(
|
||||
"query" to "{Media(idMal:$malId,type:ANIME){id}}",
|
||||
)
|
||||
).parsedSafe<DataAni>()?.data?.media?.id
|
||||
val (malId, anilistId, image, cover) = getTracker(title, typeCheck, year)
|
||||
|
||||
val episodes = document.select(".eplister > ul > li").map {
|
||||
val header = it.select(".epl-title").text()
|
||||
|
@ -176,13 +168,14 @@ class OploverzProvider : MainAPI() {
|
|||
|
||||
return newAnimeLoadResponse(title, url, type) {
|
||||
engName = title
|
||||
posterUrl = poster
|
||||
posterUrl = image ?: poster
|
||||
backgroundPosterUrl = cover ?: image ?: poster
|
||||
this.year = year
|
||||
addEpisodes(DubStatus.Subbed, episodes)
|
||||
showStatus = status
|
||||
plot = description
|
||||
this.tags = tags
|
||||
addMalId(malId?.toIntOrNull())
|
||||
addMalId(malId)
|
||||
addAniListId(anilistId?.toIntOrNull())
|
||||
this.recommendations = recommendations
|
||||
addTrailer(trailer)
|
||||
|
@ -190,11 +183,6 @@ class OploverzProvider : MainAPI() {
|
|||
|
||||
}
|
||||
|
||||
data class Source(
|
||||
@JsonProperty("play_url") val play_url: String,
|
||||
@JsonProperty("format_id") val format_id: Int
|
||||
)
|
||||
|
||||
override suspend fun loadLinks(
|
||||
data: String,
|
||||
isCasting: Boolean,
|
||||
|
@ -213,24 +201,41 @@ class OploverzProvider : MainAPI() {
|
|||
return true
|
||||
}
|
||||
|
||||
data class Data(
|
||||
@JsonProperty("mal_id") val mal_id: String? = null,
|
||||
private suspend fun getTracker(title: String?, type: String?, year: Int?): Tracker {
|
||||
val res = app.get("https://api.consumet.org/meta/anilist/$title")
|
||||
.parsedSafe<AniSearch>()?.results?.find { media ->
|
||||
(media.title?.english.equals(title, true) || media.title?.romaji.equals(
|
||||
title,
|
||||
true
|
||||
)) || (media.type.equals(type, true) && media.releaseDate == year)
|
||||
}
|
||||
return Tracker(res?.malId, res?.aniId, res?.image, res?.cover)
|
||||
}
|
||||
|
||||
data class Tracker(
|
||||
val malId: Int? = null,
|
||||
val aniId: String? = null,
|
||||
val image: String? = null,
|
||||
val cover: String? = null,
|
||||
)
|
||||
|
||||
data class JikanResponse(
|
||||
@JsonProperty("data") val data: ArrayList<Data>? = arrayListOf(),
|
||||
data class Title(
|
||||
@JsonProperty("romaji") val romaji: String? = null,
|
||||
@JsonProperty("english") val english: String? = null,
|
||||
)
|
||||
|
||||
private data class IdAni(
|
||||
@JsonProperty("id") val id: String? = null,
|
||||
data class Results(
|
||||
@JsonProperty("id") val aniId: String? = null,
|
||||
@JsonProperty("malId") val malId: Int? = null,
|
||||
@JsonProperty("title") val title: Title? = null,
|
||||
@JsonProperty("releaseDate") val releaseDate: Int? = null,
|
||||
@JsonProperty("type") val type: String? = null,
|
||||
@JsonProperty("image") val image: String? = null,
|
||||
@JsonProperty("cover") val cover: String? = null,
|
||||
)
|
||||
|
||||
private data class MediaAni(
|
||||
@JsonProperty("Media") val media: IdAni? = null,
|
||||
)
|
||||
|
||||
private data class DataAni(
|
||||
@JsonProperty("data") val data: MediaAni? = null,
|
||||
data class AniSearch(
|
||||
@JsonProperty("results") val results: ArrayList<Results>? = arrayListOf(),
|
||||
)
|
||||
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 6
|
||||
version = 7
|
||||
|
||||
|
||||
cloudstream {
|
||||
|
|
|
@ -4,12 +4,12 @@ import com.fasterxml.jackson.annotation.JsonProperty
|
|||
import com.lagradost.cloudstream3.*
|
||||
import com.lagradost.cloudstream3.LoadResponse.Companion.addAniListId
|
||||
import com.lagradost.cloudstream3.LoadResponse.Companion.addMalId
|
||||
import com.lagradost.cloudstream3.network.CloudflareKiller
|
||||
import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson
|
||||
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||
import com.lagradost.cloudstream3.utils.loadExtractor
|
||||
import org.jsoup.Jsoup
|
||||
import org.jsoup.nodes.Element
|
||||
import java.util.ArrayList
|
||||
|
||||
class OtakudesuProvider : MainAPI() {
|
||||
override var mainUrl = "https://otakudesu.bid"
|
||||
|
@ -26,8 +26,6 @@ class OtakudesuProvider : MainAPI() {
|
|||
|
||||
companion object {
|
||||
// private val interceptor = CloudflareKiller()
|
||||
private const val jikanAPI = "https://api.jikan.moe/v4"
|
||||
|
||||
fun getType(t: String): TvType {
|
||||
return if (t.contains("OVA", true) || t.contains("Special")) TvType.OVA
|
||||
else if (t.contains("Movie", true)) TvType.AnimeMovie
|
||||
|
@ -117,13 +115,8 @@ class OtakudesuProvider : MainAPI() {
|
|||
.trim()
|
||||
)
|
||||
val description = document.select("div.sinopc > p").text()
|
||||
val malId = app.get("${jikanAPI}/anime?q=$title&start_date=${year}&type=$type&limit=1")
|
||||
.parsedSafe<JikanResponse>()?.data?.firstOrNull()?.mal_id
|
||||
val anilistId = app.post(
|
||||
"https://graphql.anilist.co/", data = mapOf(
|
||||
"query" to "{Media(idMal:$malId,type:ANIME){id}}",
|
||||
)
|
||||
).parsedSafe<DataAni>()?.data?.media?.id
|
||||
|
||||
val (malId, anilistId, image, cover) = getTracker(title, type, year)
|
||||
|
||||
val episodes = document.select("div.episodelist")[1].select("ul > li").mapNotNull {
|
||||
val name = it.selectFirst("a")?.text() ?: return@mapNotNull null
|
||||
|
@ -146,13 +139,14 @@ class OtakudesuProvider : MainAPI() {
|
|||
|
||||
return newAnimeLoadResponse(title, url, getType(type)) {
|
||||
engName = title
|
||||
posterUrl = poster
|
||||
posterUrl = image ?: poster
|
||||
backgroundPosterUrl = cover ?: image ?: poster
|
||||
this.year = year
|
||||
addEpisodes(DubStatus.Subbed, episodes)
|
||||
showStatus = status
|
||||
plot = description
|
||||
this.tags = tags
|
||||
addMalId(malId?.toIntOrNull())
|
||||
addMalId(malId)
|
||||
addAniListId(anilistId?.toIntOrNull())
|
||||
this.recommendations = recommendations
|
||||
// posterHeaders = interceptor.getCookieHeaders(url).toMap()
|
||||
|
@ -230,24 +224,41 @@ class OtakudesuProvider : MainAPI() {
|
|||
return true
|
||||
}
|
||||
|
||||
data class Data(
|
||||
@JsonProperty("mal_id") val mal_id: String? = null,
|
||||
private suspend fun getTracker(title: String?, type: String?, year: Int?): Tracker {
|
||||
val res = app.get("https://api.consumet.org/meta/anilist/$title")
|
||||
.parsedSafe<AniSearch>()?.results?.find { media ->
|
||||
(media.title?.english.equals(title, true) || media.title?.romaji.equals(
|
||||
title,
|
||||
true
|
||||
)) || (media.type.equals(type, true) && media.releaseDate == year)
|
||||
}
|
||||
return Tracker(res?.malId, res?.aniId, res?.image, res?.cover)
|
||||
}
|
||||
|
||||
data class Tracker(
|
||||
val malId: Int? = null,
|
||||
val aniId: String? = null,
|
||||
val image: String? = null,
|
||||
val cover: String? = null,
|
||||
)
|
||||
|
||||
data class JikanResponse(
|
||||
@JsonProperty("data") val data: ArrayList<Data>? = arrayListOf(),
|
||||
data class Title(
|
||||
@JsonProperty("romaji") val romaji: String? = null,
|
||||
@JsonProperty("english") val english: String? = null,
|
||||
)
|
||||
|
||||
private data class IdAni(
|
||||
@JsonProperty("id") val id: String? = null,
|
||||
data class Results(
|
||||
@JsonProperty("id") val aniId: String? = null,
|
||||
@JsonProperty("malId") val malId: Int? = null,
|
||||
@JsonProperty("title") val title: Title? = null,
|
||||
@JsonProperty("releaseDate") val releaseDate: Int? = null,
|
||||
@JsonProperty("type") val type: String? = null,
|
||||
@JsonProperty("image") val image: String? = null,
|
||||
@JsonProperty("cover") val cover: String? = null,
|
||||
)
|
||||
|
||||
private data class MediaAni(
|
||||
@JsonProperty("Media") val media: IdAni? = null,
|
||||
)
|
||||
|
||||
private data class |