diff --git a/Animasu/build.gradle.kts b/Animasu/build.gradle.kts index bc5a2b18..338aaa8a 100644 --- a/Animasu/build.gradle.kts +++ b/Animasu/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 5 +version = 6 cloudstream { diff --git a/Animasu/src/main/kotlin/com/hexated/AnimasuPlugin.kt b/Animasu/src/main/kotlin/com/hexated/AnimasuPlugin.kt index 845ac534..8572dec6 100644 --- a/Animasu/src/main/kotlin/com/hexated/AnimasuPlugin.kt +++ b/Animasu/src/main/kotlin/com/hexated/AnimasuPlugin.kt @@ -10,5 +10,7 @@ class AnimasuPlugin: Plugin() { override fun load(context: Context) { // All providers should be added in this manner. Please don't edit the providers list directly. registerMainAPI(Animasu()) + registerExtractorAPI(Archivd()) + registerExtractorAPI(Newuservideo()) } } \ No newline at end of file diff --git a/Animasu/src/main/kotlin/com/hexated/Extractors.kt b/Animasu/src/main/kotlin/com/hexated/Extractors.kt new file mode 100644 index 00000000..0f40af8c --- /dev/null +++ b/Animasu/src/main/kotlin/com/hexated/Extractors.kt @@ -0,0 +1,102 @@ +package com.hexated + +import com.fasterxml.jackson.annotation.JsonProperty +import com.lagradost.cloudstream3.SubtitleFile +import com.lagradost.cloudstream3.* +import com.lagradost.cloudstream3.utils.AppUtils +import com.lagradost.cloudstream3.utils.ExtractorApi +import com.lagradost.cloudstream3.utils.ExtractorLink +import com.lagradost.cloudstream3.utils.INFER_TYPE +import com.lagradost.cloudstream3.utils.Qualities + +class Archivd : ExtractorApi() { + override val name: String = "Archivd" + override val mainUrl: String = "https://archivd.net" + override val requiresReferer = true + + override suspend fun getUrl( + url: String, + referer: String?, + subtitleCallback: (SubtitleFile) -> Unit, + callback: (ExtractorLink) -> Unit + ) { + val res = app.get(url).document + val json = res.select("div#app").attr("data-page") + val video = AppUtils.tryParseJson(json)?.props?.datas?.data?.link?.media + callback.invoke( + ExtractorLink( + this.name, + this.name, + video ?: return, + "$mainUrl/", + Qualities.Unknown.value, + INFER_TYPE + ) + ) + } + + data class Link( + @JsonProperty("media") val media: String? = null, + ) + + data class Data( + @JsonProperty("link") val link: Link? = null, + ) + + data class Datas( + @JsonProperty("data") val data: Data? = null, + ) + + data class Props( + @JsonProperty("datas") val datas: Datas? = null, + ) + + data class Sources( + @JsonProperty("props") val props: Props? = null, + ) +} + +class Newuservideo : ExtractorApi() { + override val name: String = "Uservideo" + override val mainUrl: String = "https://new.uservideo.xyz" + override val requiresReferer = true + + override suspend fun getUrl( + url: String, + referer: String?, + subtitleCallback: (SubtitleFile) -> Unit, + callback: (ExtractorLink) -> Unit + ) { + val iframe = app.get(url,referer=referer).document.select("iframe#videoFrame").attr("src") + val doc = app.get(iframe,referer="$mainUrl/").text + val json = "VIDEO_CONFIG\\s?=\\s?(.*)".toRegex().find(doc)?.groupValues?.get(1) + + AppUtils.tryParseJson(json)?.streams?.map { + callback.invoke( + ExtractorLink( + this.name, + this.name, + it.playUrl ?: return@map, + "$mainUrl/", + when (it.formatId) { + 18 -> Qualities.P360.value + 22 -> Qualities.P720.value + else -> Qualities.Unknown.value + }, + INFER_TYPE + ) + ) + } + + } + + data class Streams( + @JsonProperty("play_url") val playUrl: String? = null, + @JsonProperty("format_id") val formatId: Int? = null, + ) + + data class Sources( + @JsonProperty("streams") val streams: ArrayList? = null, + ) + +} \ No newline at end of file diff --git a/KuramanimeProvider/build.gradle.kts b/KuramanimeProvider/build.gradle.kts index c9630bb2..ed7addec 100644 --- a/KuramanimeProvider/build.gradle.kts +++ b/KuramanimeProvider/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 22 +version = 23 cloudstream { diff --git a/KuramanimeProvider/src/main/kotlin/com/hexated/KuramanimeProvider.kt b/KuramanimeProvider/src/main/kotlin/com/hexated/KuramanimeProvider.kt index b29677b2..b9805a2d 100644 --- a/KuramanimeProvider/src/main/kotlin/com/hexated/KuramanimeProvider.kt +++ b/KuramanimeProvider/src/main/kotlin/com/hexated/KuramanimeProvider.kt @@ -3,9 +3,11 @@ package com.hexated import com.lagradost.cloudstream3.* import com.lagradost.cloudstream3.LoadResponse.Companion.addAniListId import com.lagradost.cloudstream3.LoadResponse.Companion.addMalId +import com.lagradost.cloudstream3.network.WebViewResolver import com.lagradost.cloudstream3.utils.ExtractorLink import com.lagradost.cloudstream3.utils.Qualities import com.lagradost.cloudstream3.utils.loadExtractor +import com.lagradost.nicehttp.requestCreator import org.jsoup.Jsoup import org.jsoup.nodes.Element @@ -16,6 +18,7 @@ class KuramanimeProvider : MainAPI() { override val hasMainPage = true override var lang = "id" override val hasDownloadSupport = true + private var auth: String? = null private var headers: Map = mapOf() private var cookies: Map = mapOf() override val supportedTypes = setOf( @@ -199,7 +202,7 @@ class KuramanimeProvider : MainAPI() { val token = res.select("meta[name=csrf-token]").attr("content") headers = mapOf( "Accept" to "application/json, text/javascript, */*; q=0.01", - "Authorization" to "Bearer ${getAuth()}", + "Authorization" to "${getAuth(data)}", "X-Requested-With" to "XMLHttpRequest", "X-CSRF-TOKEN" to token ) @@ -225,10 +228,23 @@ class KuramanimeProvider : MainAPI() { } private fun getAuth() : String { - val key = "kuramanime2:LEcXGYdOGcMCV8jM5fhRdM2mneSj6kaNts:${APIHolder.unixTimeMS};" + val key = "kuramanime3:LEcXGYdOGcMCV8jM5fhRdM2mneSj6kaNts:${APIHolder.unixTimeMS};" return base64Encode(base64Encode(key.toByteArray()).toByteArray()) } + private suspend fun fetchAuth(url: String) : String? { + val found = WebViewResolver( + Regex("$mainUrl/misc/post/EVhcpMNbO77acNZcHr2XVjaG8WAdNC1u") + ).resolveUsingWebView( + requestCreator( + "GET", url + ) + ).first + return found?.headers?.get("Authorization") + } + + private suspend fun getAuth(url: String) = auth ?: fetchAuth(url) + private suspend fun getMisc(): String { val misc = app.get( "$mainUrl/misc/post/EVhcpMNbO77acNZcHr2XVjaG8WAdNC1u", diff --git a/RebahinProvider/build.gradle.kts b/RebahinProvider/build.gradle.kts index 2a95b588..1b2ff64e 100644 --- a/RebahinProvider/build.gradle.kts +++ b/RebahinProvider/build.gradle.kts @@ -25,5 +25,5 @@ cloudstream { ) - iconUrl = "https://www.google.com/s2/favicons?domain=104.237.198.194&sz=%size%" -} \ No newline at end of file + iconUrl = "https://www.google.com/s2/favicons?domain=179.43.163.53&sz=%size%" +} diff --git a/RebahinProvider/src/main/kotlin/com/hexated/Kitanonton.kt b/RebahinProvider/src/main/kotlin/com/hexated/Kitanonton.kt index 658f02be..00965629 100644 --- a/RebahinProvider/src/main/kotlin/com/hexated/Kitanonton.kt +++ b/RebahinProvider/src/main/kotlin/com/hexated/Kitanonton.kt @@ -3,7 +3,7 @@ package com.hexated import com.lagradost.cloudstream3.* class Kitanonton : RebahinProvider() { - override var mainUrl = "http://kitanonton.site" + override var mainUrl = "http://kitanonton.top" override var name = "KitaNonton" override var mainServer = "https://199.87.210.226" @@ -29,4 +29,4 @@ class Kitanonton : RebahinProvider() { } return newHomePageResponse(request.name, home) } -} \ No newline at end of file +} diff --git a/Samehadaku/src/main/kotlin/com/hexated/Samehadaku.kt b/Samehadaku/src/main/kotlin/com/hexated/Samehadaku.kt index 3946a988..eb5f1dd8 100644 --- a/Samehadaku/src/main/kotlin/com/hexated/Samehadaku.kt +++ b/Samehadaku/src/main/kotlin/com/hexated/Samehadaku.kt @@ -14,7 +14,7 @@ import org.jsoup.Jsoup import org.jsoup.nodes.Element class Samehadaku : MainAPI() { - override var mainUrl = "https://samehadaku.rent" + override var mainUrl = "https://samehadaku.digital/" override var name = "Samehadaku" override val hasMainPage = true override var lang = "id" @@ -258,4 +258,4 @@ class Samehadaku : MainAPI() { return this.replace(Regex("(Nonton)|(Anime)|(Subtitle\\sIndonesia)"), "").trim() } -} \ No newline at end of file +}