Nimegami: added Videogami

This commit is contained in:
Olivia 2024-01-26 02:21:19 +07:00
parent c4de07abb3
commit 25ab02c476
4 changed files with 24 additions and 10 deletions

View file

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

View file

@ -1,12 +1,8 @@
package com.hexated package com.hexated
import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.SubtitleFile import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.app import com.lagradost.cloudstream3.utils.*
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
open class Mitedrive : ExtractorApi() { open class Mitedrive : ExtractorApi() {
override val name = "Mitedrive" override val name = "Mitedrive"
@ -80,3 +76,20 @@ open class Berkasdrive : ExtractorApi() {
} }
} }
open class Videogami : ExtractorApi() {
override val name = "Videogami"
override val mainUrl = "https://video.nimegami.id"
override val requiresReferer = false
override suspend fun getUrl(
url: String,
referer: String?,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
val id = base64Decode(url.substringAfter("url=")).substringAfterLast("/")
loadExtractor("https://hxfile.co/embed-$id.html", "$mainUrl/", subtitleCallback, callback)
}
}

View file

@ -12,5 +12,6 @@ class NimegamiPlugin: Plugin() {
registerMainAPI(Nimegami()) registerMainAPI(Nimegami())
registerExtractorAPI(Mitedrive()) registerExtractorAPI(Mitedrive())
registerExtractorAPI(Berkasdrive()) registerExtractorAPI(Berkasdrive())
registerExtractorAPI(Videogami())
} }
} }

View file

@ -1065,9 +1065,9 @@ fun vidsrctoDecrypt(text: String): String {
} }
fun String?.createSlug(): String? { fun String?.createSlug(): String? {
return this?.replace(Regex("[^\\w\\s-]"), "") return this?.filter { it.isWhitespace() || it.isLetterOrDigit() }
?.replace(" ", "-") ?.trim()
?.replace(Regex("( )|( -)|(- )|(--)"), "-") ?.replace("\\s+".toRegex(), "-")
?.lowercase() ?.lowercase()
} }