mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
Nimegami: fixed missing source
This commit is contained in:
parent
27618a9589
commit
c3d3205ab5
3 changed files with 19 additions and 13 deletions
|
@ -1,5 +1,5 @@
|
|||
// use an integer for version numbers
|
||||
version = 5
|
||||
version = 6
|
||||
|
||||
|
||||
cloudstream {
|
||||
|
|
|
@ -32,13 +32,8 @@ open class Mitedrive : ExtractorApi() {
|
|||
this.name,
|
||||
this.name,
|
||||
video ?: return,
|
||||
"$mainUrl/",
|
||||
"",
|
||||
Qualities.Unknown.value,
|
||||
headers = mapOf(
|
||||
"Accept" to "video/webm,video/ogg,video/*;q=0.9,application/ogg;q=0.7,audio/*;q=0.6,*/*;q=0.5",
|
||||
"Sec-Fetch-Dest" to "video",
|
||||
"Sec-Fetch-Mode" to "no-cors",
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
@ -104,7 +104,8 @@ class Nimegami : MainAPI() {
|
|||
|
||||
val episodes = document.select("div.list_eps_stream li")
|
||||
.mapNotNull {
|
||||
val episode = Regex("Episode\\s?(\\d+)").find(it.text())?.groupValues?.getOrNull(0)?.toIntOrNull()
|
||||
val episode = Regex("Episode\\s?(\\d+)").find(it.text())?.groupValues?.getOrNull(0)
|
||||
?.toIntOrNull()
|
||||
val link = it.attr("data")
|
||||
Episode(link, episode = episode)
|
||||
}
|
||||
|
@ -148,7 +149,13 @@ class Nimegami : MainAPI() {
|
|||
|
||||
tryParseJson<ArrayList<Sources>>(base64Decode(data))?.map { sources ->
|
||||
sources.url?.apmap { url ->
|
||||
loadFixedExtractor(url.fixIframe(), sources.format, "$mainUrl/", subtitleCallback, callback)
|
||||
loadFixedExtractor(
|
||||
url.fixIframe(),
|
||||
sources.format,
|
||||
"$mainUrl/",
|
||||
subtitleCallback,
|
||||
callback
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -190,12 +197,16 @@ class Nimegami : MainAPI() {
|
|||
|
||||
private fun String.fixIframe(): String {
|
||||
val url = base64Decode(this.substringAfter("url=").substringAfter("id="))
|
||||
val host = getBaseUrl(url)
|
||||
return when {
|
||||
url.contains("hxfile") -> {
|
||||
val host = getBaseUrl(url)
|
||||
val id = url.substringAfterLast("/")
|
||||
"$host/embed-$id.html"
|
||||
}
|
||||
url.startsWith("https://mitedrive.my.id") -> url.replace(
|
||||
"https://mitedrive.my.id",
|
||||
"https://mitedrive.com"
|
||||
)
|
||||
else -> fixUrl(url)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue