From cca513b1ff41849905f0b777dcf4bf7d541f4e06 Mon Sep 17 00:00:00 2001 From: hexated Date: Sat, 20 May 2023 03:21:12 +0700 Subject: [PATCH] Anime providers [indonesian] : Moved into inbuild tracker --- AnimeSailProvider/build.gradle.kts | 2 +- .../kotlin/com/hexated/AnimeSailProvider.kt | 49 +--------- Gomunimeis/build.gradle.kts | 2 +- .../src/main/kotlin/com/hexated/Gomunimeis.kt | 45 +--------- KuramanimeProvider/build.gradle.kts | 2 +- .../kotlin/com/hexated/KuramanimeProvider.kt | 47 +--------- KuronimeProvider/build.gradle.kts | 2 +- .../kotlin/com/hexated/KuronimeProvider.kt | 45 +--------- NeonimeProvider/build.gradle.kts | 2 +- .../kotlin/com/hexated/NeonimeProvider.kt | 53 +---------- NontonAnimeIDProvider/build.gradle.kts | 2 +- .../com/hexated/NontonAnimeIDProvider.kt | 46 +--------- OploverzProvider/build.gradle.kts | 2 +- .../src/main/kotlin/com/hexated/Extractors.kt | 89 ------------------- .../kotlin/com/hexated/OploverzProvider.kt | 50 +---------- .../com/hexated/OploverzProviderPlugin.kt | 2 - OtakudesuProvider/build.gradle.kts | 2 +- .../kotlin/com/hexated/OtakudesuProvider.kt | 53 +---------- Samehadaku/build.gradle.kts | 2 +- .../src/main/kotlin/com/hexated/Samehadaku.kt | 51 +---------- 20 files changed, 26 insertions(+), 522 deletions(-) delete mode 100644 OploverzProvider/src/main/kotlin/com/hexated/Extractors.kt diff --git a/AnimeSailProvider/build.gradle.kts b/AnimeSailProvider/build.gradle.kts index 9152ae54..bbfed124 100644 --- a/AnimeSailProvider/build.gradle.kts +++ b/AnimeSailProvider/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 7 +version = 8 cloudstream { diff --git a/AnimeSailProvider/src/main/kotlin/com/hexated/AnimeSailProvider.kt b/AnimeSailProvider/src/main/kotlin/com/hexated/AnimeSailProvider.kt index 5b9285b4..45094af4 100644 --- a/AnimeSailProvider/src/main/kotlin/com/hexated/AnimeSailProvider.kt +++ b/AnimeSailProvider/src/main/kotlin/com/hexated/AnimeSailProvider.kt @@ -1,9 +1,6 @@ package com.hexated -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.mvvm.safeApiCall import com.lagradost.cloudstream3.utils.ExtractorLink import com.lagradost.cloudstream3.utils.Qualities @@ -113,8 +110,6 @@ class AnimeSailProvider : MainAPI() { 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, anilistId, image, cover) = getTracker(title, type, year) - val episodes = document.select("ul.daftar > li").map { val link = fixUrl(it.select("a").attr("href")) val name = it.select("a").text() @@ -123,8 +118,7 @@ class AnimeSailProvider : MainAPI() { }.reversed() return newAnimeLoadResponse(title, url, getType(type)) { - posterUrl = image ?: poster - backgroundPosterUrl = cover ?: image ?: poster + posterUrl = poster this.year = year addEpisodes(DubStatus.Subbed, episodes) showStatus = @@ -132,8 +126,6 @@ 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) - addAniListId(anilistId?.toIntOrNull()) } } @@ -165,7 +157,7 @@ class AnimeSailProvider : MainAPI() { else -> this.name } val quality = - Regex("\\.([0-9]{3,4})\\.").find(link)?.groupValues?.get(1) + Regex("\\.(\\d{3,4})\\.").find(link)?.groupValues?.get(1) callback.invoke( ExtractorLink( source = source, @@ -201,41 +193,4 @@ class AnimeSailProvider : 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()?.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? = arrayListOf(), - ) - } \ No newline at end of file diff --git a/Gomunimeis/build.gradle.kts b/Gomunimeis/build.gradle.kts index 0d252b37..5c6d720f 100644 --- a/Gomunimeis/build.gradle.kts +++ b/Gomunimeis/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 4 +version = 5 cloudstream { diff --git a/Gomunimeis/src/main/kotlin/com/hexated/Gomunimeis.kt b/Gomunimeis/src/main/kotlin/com/hexated/Gomunimeis.kt index 8f8b6533..2a028c5b 100644 --- a/Gomunimeis/src/main/kotlin/com/hexated/Gomunimeis.kt +++ b/Gomunimeis/src/main/kotlin/com/hexated/Gomunimeis.kt @@ -2,8 +2,6 @@ package com.hexated 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.utils.* import java.util.ArrayList @@ -100,7 +98,6 @@ 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, anilistId, image, cover) = getTracker(title, type, year) val episodes = document.select(".eplister > ul > li").map { val episode = Regex("Episode\\s?(\\d+)").find( it.select(".epl-title").text() @@ -111,13 +108,10 @@ class Gomunimeis : MainAPI() { return newAnimeLoadResponse(title, url, getType(type)) { engName = title - posterUrl = image ?: poster - backgroundPosterUrl = cover ?: image ?: poster + posterUrl = poster this.year = year addEpisodes(DubStatus.Subbed, episodes) showStatus = status - addMalId(malId) - addAniListId(anilistId?.toIntOrNull()) plot = description this.tags = tags } @@ -142,43 +136,6 @@ 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()?.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? = arrayListOf(), - ) - data class Streamsb( @JsonProperty("link") val link: String?, ) diff --git a/KuramanimeProvider/build.gradle.kts b/KuramanimeProvider/build.gradle.kts index 0479f234..6b7a0fb8 100644 --- a/KuramanimeProvider/build.gradle.kts +++ b/KuramanimeProvider/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 10 +version = 11 cloudstream { diff --git a/KuramanimeProvider/src/main/kotlin/com/hexated/KuramanimeProvider.kt b/KuramanimeProvider/src/main/kotlin/com/hexated/KuramanimeProvider.kt index 848a5f8e..aaca6059 100644 --- a/KuramanimeProvider/src/main/kotlin/com/hexated/KuramanimeProvider.kt +++ b/KuramanimeProvider/src/main/kotlin/com/hexated/KuramanimeProvider.kt @@ -1,16 +1,12 @@ package com.hexated -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.mvvm.safeApiCall 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" @@ -112,7 +108,6 @@ 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, anilistId, image, cover) = getTracker(title, type, year) val episodes = mutableListOf() @@ -142,14 +137,11 @@ class KuramanimeProvider : MainAPI() { return newAnimeLoadResponse(title, url, getType(type, episodes.size)) { engName = title - posterUrl = image ?: poster - backgroundPosterUrl = cover ?: image ?: poster + posterUrl = poster this.year = year addEpisodes(DubStatus.Subbed, episodes) showStatus = status plot = description - addMalId(malId) - addAniListId(anilistId?.toIntOrNull()) this.tags = tags this.recommendations = recommendations } @@ -212,41 +204,4 @@ class KuramanimeProvider : 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()?.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? = arrayListOf(), - ) - } \ No newline at end of file diff --git a/KuronimeProvider/build.gradle.kts b/KuronimeProvider/build.gradle.kts index 535b1815..ce0f90dd 100644 --- a/KuronimeProvider/build.gradle.kts +++ b/KuronimeProvider/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 10 +version = 11 cloudstream { diff --git a/KuronimeProvider/src/main/kotlin/com/hexated/KuronimeProvider.kt b/KuronimeProvider/src/main/kotlin/com/hexated/KuronimeProvider.kt index 2e294a4e..07ca42d1 100644 --- a/KuronimeProvider/src/main/kotlin/com/hexated/KuronimeProvider.kt +++ b/KuronimeProvider/src/main/kotlin/com/hexated/KuronimeProvider.kt @@ -2,8 +2,6 @@ package com.hexated 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.LoadResponse.Companion.addTrailer import com.lagradost.cloudstream3.mvvm.safeApiCall import com.lagradost.cloudstream3.utils.ExtractorLink @@ -128,7 +126,6 @@ class KuronimeProvider : MainAPI() { val year = Regex("\\d, (\\d*)").find( document.select(".infodetail > ul > li:nth-child(5)").text() )?.groupValues?.get(1)?.toIntOrNull() - val (malId, anilistId, image, cover) = getTracker(title, type, year) val status = getStatus( document.selectFirst(".infodetail > ul > li:nth-child(3)")!!.ownText() .replace(Regex("\\W"), "") @@ -145,14 +142,11 @@ class KuronimeProvider : MainAPI() { return newAnimeLoadResponse(title, url, getType(type)) { engName = title - posterUrl = image ?: poster - backgroundPosterUrl = cover ?: image ?: poster + posterUrl = poster this.year = year addEpisodes(DubStatus.Subbed, episodes) showStatus = status plot = description - addMalId(malId) - addAniListId(anilistId?.toIntOrNull()) addTrailer(trailer) this.tags = tags } @@ -211,43 +205,6 @@ class KuronimeProvider : 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()?.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? = arrayListOf(), - ) - data class All( @JsonProperty("post_image") var postImage: String? = null, @JsonProperty("post_image_html") var postImageHtml: String? = null, diff --git a/NeonimeProvider/build.gradle.kts b/NeonimeProvider/build.gradle.kts index efe9fdd7..657d7382 100644 --- a/NeonimeProvider/build.gradle.kts +++ b/NeonimeProvider/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 6 +version = 7 cloudstream { diff --git a/NeonimeProvider/src/main/kotlin/com/hexated/NeonimeProvider.kt b/NeonimeProvider/src/main/kotlin/com/hexated/NeonimeProvider.kt index c54f055f..bd7059d5 100644 --- a/NeonimeProvider/src/main/kotlin/com/hexated/NeonimeProvider.kt +++ b/NeonimeProvider/src/main/kotlin/com/hexated/NeonimeProvider.kt @@ -1,15 +1,11 @@ package com.hexated -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.LoadResponse.Companion.addTrailer import com.lagradost.cloudstream3.utils.ExtractorLink import com.lagradost.cloudstream3.utils.loadExtractor import org.jsoup.nodes.Element import java.net.URI -import java.util.* class NeonimeProvider : MainAPI() { override var mainUrl = "https://neonime.fun" @@ -124,17 +120,13 @@ class NeonimeProvider : MainAPI() { 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, anilistId, image, cover) = getTracker(mTitle, "movie", year) return newMovieLoadResponse(name = mTitle, url = url, type = TvType.Movie, dataUrl = url) { - posterUrl = image ?: mPoster - backgroundPosterUrl = cover ?: image ?: mPoster + posterUrl = 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) - addAniListId(anilistId?.toIntOrNull()) } } else { @@ -142,7 +134,6 @@ class NeonimeProvider : MainAPI() { 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, anilistId, image, cover) = getTracker(title, "tv", year) val episodes = document.select("ul.episodios > li").mapNotNull { val link = fixUrl(it.selectFirst(".episodiotitle > a")!!.attr("href")) val name = it.selectFirst(".episodiotitle > a")?.ownText().toString() @@ -152,16 +143,13 @@ class NeonimeProvider : MainAPI() { return newAnimeLoadResponse(title, url, TvType.Anime) { engName = title - posterUrl = image ?: poster - backgroundPosterUrl = cover ?: image ?: poster + posterUrl = 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) - addAniListId(anilistId?.toIntOrNull()) } } } @@ -195,41 +183,4 @@ class NeonimeProvider : MainAPI() { } } - private suspend fun getTracker(title: String?, type: String?, year: Int?): Tracker { - val res = app.get("https://api.consumet.org/meta/anilist/$title") - .parsedSafe()?.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? = arrayListOf(), - ) - } \ No newline at end of file diff --git a/NontonAnimeIDProvider/build.gradle.kts b/NontonAnimeIDProvider/build.gradle.kts index 97e9124e..93fbd4b3 100644 --- a/NontonAnimeIDProvider/build.gradle.kts +++ b/NontonAnimeIDProvider/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 13 +version = 14 cloudstream { diff --git a/NontonAnimeIDProvider/src/main/kotlin/com/hexated/NontonAnimeIDProvider.kt b/NontonAnimeIDProvider/src/main/kotlin/com/hexated/NontonAnimeIDProvider.kt index 636302ae..2cefaa1e 100644 --- a/NontonAnimeIDProvider/src/main/kotlin/com/hexated/NontonAnimeIDProvider.kt +++ b/NontonAnimeIDProvider/src/main/kotlin/com/hexated/NontonAnimeIDProvider.kt @@ -2,8 +2,6 @@ package com.hexated 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.LoadResponse.Companion.addTrailer import com.lagradost.cloudstream3.utils.ExtractorLink import com.lagradost.cloudstream3.utils.loadExtractor @@ -133,8 +131,6 @@ class NontonAnimeIDProvider : MainAPI() { val description = document.select(".entry-content.seriesdesc > p").text().trim() val trailer = document.selectFirst("a.trailerbutton")?.attr("href") - 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") val numEp = @@ -181,15 +177,12 @@ class NontonAnimeIDProvider : MainAPI() { return newAnimeLoadResponse(title, url, getType(type)) { engName = title - posterUrl = image ?: poster - backgroundPosterUrl = cover ?: image ?: poster + posterUrl = poster this.year = year addEpisodes(DubStatus.Subbed, episodes) showStatus = status this.rating = rating plot = description - addMalId(malId) - addAniListId(anilistId?.toIntOrNull()) addTrailer(trailer) this.tags = tags this.recommendations = recommendations @@ -234,43 +227,6 @@ 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()?.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? = arrayListOf(), - ) - private data class EpResponse( @JsonProperty("posts") val posts: String?, @JsonProperty("max_page") val max_page: Int?, diff --git a/OploverzProvider/build.gradle.kts b/OploverzProvider/build.gradle.kts index 44eac8e4..34e401b9 100644 --- a/OploverzProvider/build.gradle.kts +++ b/OploverzProvider/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 14 +version = 15 cloudstream { diff --git a/OploverzProvider/src/main/kotlin/com/hexated/Extractors.kt b/OploverzProvider/src/main/kotlin/com/hexated/Extractors.kt deleted file mode 100644 index bb6fc3cb..00000000 --- a/OploverzProvider/src/main/kotlin/com/hexated/Extractors.kt +++ /dev/null @@ -1,89 +0,0 @@ -package com.hexated - -import com.fasterxml.jackson.annotation.JsonProperty -import com.lagradost.cloudstream3.SubtitleFile -import com.lagradost.cloudstream3.app -import com.lagradost.cloudstream3.utils.* - -class Krakenfiles : ExtractorApi() { - override val name = "Krakenfiles" - override val mainUrl = "https://krakenfiles.com" - override val requiresReferer = false - - override suspend fun getUrl( - url: String, - referer: String?, - subtitleCallback: (SubtitleFile) -> Unit, - callback: (ExtractorLink) -> Unit - ) { - val id = Regex("(?://|\\.)(krakenfiles\\.com)/(?:view|embed-video)?/([\\da-zA-Z]+)").find(url)?.groupValues?.get(2) - val doc = app.get("$mainUrl/embed-video/$id").document - val link = doc.selectFirst("source")?.attr("src") - - callback.invoke( - ExtractorLink( - this.name, - this.name, - httpsify(link ?: return), - "", - Qualities.Unknown.value - ) - ) - - } - -} - -class Gofile : ExtractorApi() { - override val name = "Gofile" - override val mainUrl = "https://gofile.io" - override val requiresReferer = false - private val mainApi = "https://api.gofile.io" - - override suspend fun getUrl( - url: String, - referer: String?, - subtitleCallback: (SubtitleFile) -> Unit, - callback: (ExtractorLink) -> Unit - ) { - val id = - Regex("(?://|\\.)(gofile\\.io)/(?:\\?c=|d/)([\\da-zA-Z]+)").find(url)?.groupValues?.get( - 2 - ) - val token = app.get("$mainApi/createAccount").parsedSafe()?.data?.get("token") - app.get("$mainApi/getContent?contentId=$id&token=$token&websiteToken=12345") - .parsedSafe()?.data?.contents?.forEach { - callback.invoke( - ExtractorLink( - this.name, - this.name, - it.value["link"] ?: return, - "", - getQuality(it.value["name"]), - headers = mapOf( - "Cookie" to "accountToken=$token" - ) - ) - ) - } - - } - - private fun getQuality(str: String?): Int { - return Regex("(\\d{3,4})[pP]").find(str ?: "")?.groupValues?.getOrNull(1)?.toIntOrNull() - ?: Qualities.Unknown.value - } - - data class Account( - @JsonProperty("data") val data: HashMap? = null, - ) - - data class Data( - @JsonProperty("contents") val contents: HashMap>? = null, - ) - - data class Source( - @JsonProperty("data") val data: Data? = null, - ) - -} \ No newline at end of file diff --git a/OploverzProvider/src/main/kotlin/com/hexated/OploverzProvider.kt b/OploverzProvider/src/main/kotlin/com/hexated/OploverzProvider.kt index 8ba3d892..e75921bd 100644 --- a/OploverzProvider/src/main/kotlin/com/hexated/OploverzProvider.kt +++ b/OploverzProvider/src/main/kotlin/com/hexated/OploverzProvider.kt @@ -2,14 +2,11 @@ package com.hexated 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.LoadResponse.Companion.addTrailer import com.lagradost.cloudstream3.extractors.Filesim import com.lagradost.cloudstream3.utils.* import org.jsoup.Jsoup import org.jsoup.nodes.Element -import java.util.ArrayList class OploverzProvider : MainAPI() { override var mainUrl = "https://oploverz.top" @@ -144,12 +141,9 @@ class OploverzProvider : MainAPI() { "Movie" -> "Movie" else -> "TV" } - val type = getType(typeCheck) val description = document.select(".entry-content > p").text().trim() val trailer = document.selectFirst("a.trailerbutton")?.attr("href") - val (malId, anilistId, image, cover) = getTracker(title, typeCheck, year) - val episodes = document.select(".eplister > ul > li").map { val link = fixUrl(it.select("a").attr("href")) val name = it.select(".epl-title").text() @@ -170,17 +164,14 @@ class OploverzProvider : MainAPI() { } } - return newAnimeLoadResponse(title, url, type) { + return newAnimeLoadResponse(title, url, getType(typeCheck)) { engName = title - posterUrl = image ?: poster - backgroundPosterUrl = cover ?: image ?: poster + posterUrl = poster this.year = year addEpisodes(DubStatus.Subbed, episodes) showStatus = status plot = description this.tags = tags - addMalId(malId) - addAniListId(anilistId?.toIntOrNull()) this.recommendations = recommendations addTrailer(trailer) } @@ -252,43 +243,6 @@ class OploverzProvider : MainAPI() { } } - private suspend fun getTracker(title: String?, type: String?, year: Int?): Tracker { - val res = app.get("https://api.consumet.org/meta/anilist/$title") - .parsedSafe()?.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? = arrayListOf(), - ) - data class RList( @JsonProperty("url") val url: String, @JsonProperty("resolution") val resolution: String?, diff --git a/OploverzProvider/src/main/kotlin/com/hexated/OploverzProviderPlugin.kt b/OploverzProvider/src/main/kotlin/com/hexated/OploverzProviderPlugin.kt index af4f1193..dfba47b4 100644 --- a/OploverzProvider/src/main/kotlin/com/hexated/OploverzProviderPlugin.kt +++ b/OploverzProvider/src/main/kotlin/com/hexated/OploverzProviderPlugin.kt @@ -11,7 +11,5 @@ class OploverzProviderPlugin: Plugin() { // All providers should be added in this manner. Please don't edit the providers list directly. registerMainAPI(OploverzProvider()) registerExtractorAPI(Streamhide()) - registerExtractorAPI(Krakenfiles()) - registerExtractorAPI(Gofile()) } } \ No newline at end of file diff --git a/OtakudesuProvider/build.gradle.kts b/OtakudesuProvider/build.gradle.kts index 7218197b..5e05690f 100644 --- a/OtakudesuProvider/build.gradle.kts +++ b/OtakudesuProvider/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 11 +version = 12 cloudstream { diff --git a/OtakudesuProvider/src/main/kotlin/com/hexated/OtakudesuProvider.kt b/OtakudesuProvider/src/main/kotlin/com/hexated/OtakudesuProvider.kt index ee5c77c1..761b5d62 100644 --- a/OtakudesuProvider/src/main/kotlin/com/hexated/OtakudesuProvider.kt +++ b/OtakudesuProvider/src/main/kotlin/com/hexated/OtakudesuProvider.kt @@ -2,15 +2,12 @@ package com.hexated 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.extractors.JWPlayer 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.lol" @@ -65,7 +62,7 @@ class OtakudesuProvider : MainAPI() { val title = this.selectFirst("h2.jdlflm")?.text()?.trim() ?: return null val href = this.selectFirst("a")!!.attr("href") val posterUrl = this.select("div.thumbz > img").attr("src").toString() - val epNum = this.selectFirst("div.epz")?.ownText()?.replace(Regex("[^0-9]"), "")?.trim() + val epNum = this.selectFirst("div.epz")?.ownText()?.replace(Regex("\\D"), "")?.trim() ?.toIntOrNull() return newAnimeSearchResponse(title, href, TvType.Anime) { this.posterUrl = posterUrl @@ -107,7 +104,7 @@ class OtakudesuProvider : MainAPI() { val type = document.selectFirst("div.infozingle > p:nth-child(5) > span")?.ownText() ?.replace(":", "")?.trim() ?: "tv" - val year = Regex("\\d, ([0-9]*)").find( + val year = Regex("\\d, (\\d*)").find( document.select("div.infozingle > p:nth-child(9) > span").text() )?.groupValues?.get(1)?.toIntOrNull() val status = getStatus( @@ -117,11 +114,9 @@ class OtakudesuProvider : MainAPI() { ) val description = document.select("div.sinopc > p").text() - 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 - val episode = Regex("Episode\\s?([0-9]+)").find(name)?.groupValues?.getOrNull(0) + val episode = Regex("Episode\\s?(\\d+)").find(name)?.groupValues?.getOrNull(0) ?: it.selectFirst("a")?.text() val link = fixUrl(it.selectFirst("a")!!.attr("href")) Episode(link, name, episode = episode?.toIntOrNull()) @@ -140,15 +135,12 @@ class OtakudesuProvider : MainAPI() { return newAnimeLoadResponse(title, url, getType(type)) { engName = title - posterUrl = image ?: poster - backgroundPosterUrl = cover ?: image ?: poster + posterUrl = poster this.year = year addEpisodes(DubStatus.Subbed, episodes) showStatus = status plot = description this.tags = tags - addMalId(malId) - addAniListId(anilistId?.toIntOrNull()) this.recommendations = recommendations // posterHeaders = interceptor.getCookieHeaders(url).toMap() } @@ -222,43 +214,6 @@ class OtakudesuProvider : 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()?.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? = arrayListOf(), - ) - } class Moedesu : JWPlayer() { diff --git a/Samehadaku/build.gradle.kts b/Samehadaku/build.gradle.kts index 764d890f..6bd22315 100644 --- a/Samehadaku/build.gradle.kts +++ b/Samehadaku/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 8 +version = 9 cloudstream { diff --git a/Samehadaku/src/main/kotlin/com/hexated/Samehadaku.kt b/Samehadaku/src/main/kotlin/com/hexated/Samehadaku.kt index 7d26bd84..e994b2d4 100644 --- a/Samehadaku/src/main/kotlin/com/hexated/Samehadaku.kt +++ b/Samehadaku/src/main/kotlin/com/hexated/Samehadaku.kt @@ -1,9 +1,6 @@ package com.hexated -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.LoadResponse.Companion.addTrailer import com.lagradost.cloudstream3.extractors.XStreamCdn import com.lagradost.cloudstream3.utils.ExtractorLink @@ -105,7 +102,7 @@ class Samehadaku : MainAPI() { val poster = document.selectFirst("div.thumb > img")?.attr("src") val tags = document.select("div.genre-info > a").map { it.text() } val year = document.selectFirst("div.spe > span:contains(Rilis)")?.ownText()?.let { - Regex("\\d,\\s([0-9]*)").find(it)?.groupValues?.getOrNull(1)?.toIntOrNull() + Regex("\\d,\\s(\\d*)").find(it)?.groupValues?.getOrNull(1)?.toIntOrNull() } val status = getStatus(document.selectFirst("div.spe > span:contains(Status)")?.ownText() ?: return null) val type = document.selectFirst("div.spe > span:contains(Type)")?.ownText()?.trim()?.lowercase() ?: "tv" @@ -113,11 +110,9 @@ class Samehadaku : MainAPI() { val description = document.select("div.desc p").text().trim() val trailer = document.selectFirst("div.trailer-anime iframe")?.attr("src") - val (malId, anilistId, image, cover) = getTracker(title, type, year) - val episodes = document.select("div.lstepsiode.listeps ul li").mapNotNull { val header = it.selectFirst("span.lchx > a") ?: return@mapNotNull null - val episode = Regex("Episode\\s?([0-9]+)").find(header.text())?.groupValues?.getOrNull(1)?.toIntOrNull() + val episode = Regex("Episode\\s?(\\d+)").find(header.text())?.groupValues?.getOrNull(1)?.toIntOrNull() val link = fixUrl(header.attr("href")) Episode(link, episode = episode) }.reversed() @@ -128,15 +123,12 @@ class Samehadaku : MainAPI() { return newAnimeLoadResponse(title, url, getType(type)) { engName = title - posterUrl = image ?: poster - backgroundPosterUrl = cover ?: image ?: poster + posterUrl = poster this.year = year addEpisodes(DubStatus.Subbed, episodes) showStatus = status this.rating = rating plot = description - addMalId(malId) - addAniListId(anilistId?.toIntOrNull()) addTrailer(trailer) this.tags = tags this.recommendations = recommendations @@ -184,43 +176,6 @@ class Samehadaku : MainAPI() { return this.replace(Regex("(Nonton)|(Anime)|(Subtitle\\sIndonesia)"), "").trim() } - private suspend fun getTracker(title: String?, type: String?, year: Int?): Tracker { - val res = app.get("https://api.consumet.org/meta/anilist/$title") - .parsedSafe()?.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? = arrayListOf(), - ) - } class Suzihaza: XStreamCdn() {