Merge branch 'master' into adityajd-patch-1

This commit is contained in:
adityajd 2023-11-30 09:00:18 +07:00 committed by GitHub
commit 4c9bd706f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 130 additions and 10 deletions

View File

@ -1,5 +1,5 @@
// use an integer for version numbers
version = 5
version = 6
cloudstream {

View File

@ -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())
}
}

View File

@ -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<Sources>(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<Sources>(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<Streams>? = null,
)
}

View File

@ -1,5 +1,5 @@
// use an integer for version numbers
version = 22
version = 23
cloudstream {

View File

@ -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<String,String> = mapOf()
private var cookies: Map<String,String> = 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",

View File

@ -25,5 +25,5 @@ cloudstream {
)
iconUrl = "https://www.google.com/s2/favicons?domain=104.237.198.194&sz=%size%"
}
iconUrl = "https://www.google.com/s2/favicons?domain=179.43.163.53&sz=%size%"
}

View File

@ -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)
}
}
}

View File

@ -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()
}
}
}