Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.lagradost.cloudstream3.SubtitleFile
import com.lagradost.cloudstream3.utils.ExtractorApi
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.loadExtractor
import okhttp3.HttpUrl.Companion.toHttpUrl
import io.ktor.http.Url

// deobfuscated from https://hglink.to/main.js?v=1.1.3 using https://deobfuscate.io/
private val mirrors = arrayOf(
Expand Down Expand Up @@ -90,12 +90,12 @@ abstract class CineMMRedirect : ExtractorApi() {
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
val videoId = url.toHttpUrl().encodedPath
val videoId = Url(url).encodedPath
val mirror = mirrors.random()

// re-use existing extractors by calling the ExtractorApi
// of the randomly selected mirror URL
val mirrorUrlWithVideoId = "https://$mirror$videoId"
loadExtractor(mirrorUrlWithVideoId, referer, subtitleCallback, callback)
}
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
package com.lagradost.cloudstream3.utils

import com.lagradost.cloudstream3.Prerelease
import io.ktor.http.decodeURLQueryComponent
import io.ktor.http.encodeURLParameter

object StringUtils {
@Prerelease
fun String.decodeUrl(): String {
return this.decodeURLQueryComponent()
}

@Prerelease
fun String.encodeUrl(): String {
return this.encodeURLParameter()
}
Expand Down