fixed nimegami

This commit is contained in:
jack 2023-11-17 02:55:54 +07:00
parent f2fbf9c2f7
commit 8396000a30
4 changed files with 8 additions and 15 deletions

View file

@ -108,12 +108,7 @@ object NineTv {
val res = app.get(url, headers = mapOf( val res = app.get(url, headers = mapOf(
"Accept" to "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8", "Accept" to "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
"Accept-Language" to "en-US,en;q=0.5", "Accept-Language" to "en-US,en;q=0.5",
"Connection" to "keep-alive",
"Referer" to (referer ?: ""), "Referer" to (referer ?: ""),
"Sec-Fetch-Dest" to "iframe",
"Sec-Fetch-Mode" to "navigate",
"Sec-Fetch-Site" to "same-origin",
"Upgrade-Insecure-Requests" to "1"
)) ))
val master = Regex("\\s*=\\s*'([^']+)").find(res.text)?.groupValues?.get(1) val master = Regex("\\s*=\\s*'([^']+)").find(res.text)?.groupValues?.get(1)
val key = res.document.getKeys() ?: throw ErrorLoadingException("can't generate key") val key = res.document.getKeys() ?: throw ErrorLoadingException("can't generate key")

View file

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

View file

@ -5,6 +5,7 @@ import com.lagradost.cloudstream3.SubtitleFile
import com.lagradost.cloudstream3.app import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.utils.ExtractorApi import com.lagradost.cloudstream3.utils.ExtractorApi
import com.lagradost.cloudstream3.utils.ExtractorLink import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.INFER_TYPE
import com.lagradost.cloudstream3.utils.Qualities import com.lagradost.cloudstream3.utils.Qualities
open class Mitedrive : ExtractorApi() { open class Mitedrive : ExtractorApi() {
@ -20,10 +21,11 @@ open class Mitedrive : ExtractorApi() {
) { ) {
val id = url.substringAfterLast("/") val id = url.substringAfterLast("/")
val video = app.post( val video = app.post(
"$mainUrl/api/generate", "https://api.mitedrive.com/api/view/$id",
referer = "$mainUrl/", referer = "$mainUrl/",
data = mapOf( data = mapOf(
"short_url" to id "csrf_token" to "ZXlKcGNDSTZJak0yTGpneExqWTFMakUyTWlJc0ltUmxkbWxqWlNJNklrMXZlbWxzYkdFdk5TNHdJQ2hYYVc1a2IzZHpJRTVVSURFd0xqQTdJRmRwYmpZME95QjROalE3SUhKMk9qRXdNUzR3S1NCSFpXTnJieTh5TURFd01ERXdNU0JHYVhKbFptOTRMekV3TVM0d0lpd2lZbkp2ZDNObGNpSTZJazF2ZW1sc2JHRWlMQ0pqYjI5cmFXVWlPaUlpTENKeVpXWmxjbkpsY2lJNklpSjk=",
"slug" to id
) )
).parsedSafe<Responses>()?.data?.url ).parsedSafe<Responses>()?.data?.url
@ -32,15 +34,16 @@ open class Mitedrive : ExtractorApi() {
this.name, this.name,
this.name, this.name,
video ?: return, video ?: return,
"", "$mainUrl/",
Qualities.Unknown.value, Qualities.Unknown.value,
INFER_TYPE,
) )
) )
} }
data class Data( data class Data(
@JsonProperty("url") val url: String? = null, @JsonProperty("original_url") val url: String? = null,
) )
data class Responses( data class Responses(

View file

@ -250,12 +250,7 @@ object NineTv {
val res = app.get(url, headers = mapOf( val res = app.get(url, headers = mapOf(
"Accept" to "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8", "Accept" to "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
"Accept-Language" to "en-US,en;q=0.5", "Accept-Language" to "en-US,en;q=0.5",
"Connection" to "keep-alive",
"Referer" to (referer ?: ""), "Referer" to (referer ?: ""),
"Sec-Fetch-Dest" to "iframe",
"Sec-Fetch-Mode" to "navigate",
"Sec-Fetch-Site" to "same-origin",
"Upgrade-Insecure-Requests" to "1"
)) ))
val master = Regex("\\s*=\\s*'([^']+)").find(res.text)?.groupValues?.get(1) val master = Regex("\\s*=\\s*'([^']+)").find(res.text)?.groupValues?.get(1)
val key = res.document.getKeys() ?: throw ErrorLoadingException("can't generate key") val key = res.document.getKeys() ?: throw ErrorLoadingException("can't generate key")