mirror of
https://github.com/recloudstream/cloudstream.git
synced 2025-05-17 19:25:55 +08:00
Fixed okru extractor (#1301)
Co-authored-by: misajimenezmx <misajimenez.mx@gmail.com>
This commit is contained in:
@ -13,11 +13,17 @@ open class Odnoklassniki : ExtractorApi() {
|
|||||||
override val requiresReferer = false
|
override val requiresReferer = false
|
||||||
|
|
||||||
override suspend fun getUrl(url: String, referer: String?, subtitleCallback: (SubtitleFile) -> Unit, callback: (ExtractorLink) -> Unit) {
|
override suspend fun getUrl(url: String, referer: String?, subtitleCallback: (SubtitleFile) -> Unit, callback: (ExtractorLink) -> Unit) {
|
||||||
val extRef = referer ?: ""
|
val headers = mapOf(
|
||||||
|
"Accept" to "*/*",
|
||||||
|
"Connection" to "keep-alive",
|
||||||
|
"Sec-Fetch-Dest" to "empty",
|
||||||
|
"Sec-Fetch-Mode" to "cors",
|
||||||
|
"Sec-Fetch-Site" to "cross-site",
|
||||||
|
"Origin" to mainUrl,
|
||||||
|
"User-Agent" to USER_AGENT,
|
||||||
|
)
|
||||||
|
|
||||||
val userAgent = mapOf("User-Agent" to "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Mobile Safari/537.36")
|
val videoReq = app.get(url, headers=headers).text.replace("\\"", "\"").replace("\\\\", "\\")
|
||||||
|
|
||||||
val videoReq = app.get(url, headers=userAgent).text.replace("\\"", "\"").replace("\\\\", "\\")
|
|
||||||
.replace(Regex("\\\\u([0-9A-Fa-f]{4})")) { matchResult ->
|
.replace(Regex("\\\\u([0-9A-Fa-f]{4})")) { matchResult ->
|
||||||
Integer.parseInt(matchResult.groupValues[1], 16).toChar().toString()
|
Integer.parseInt(matchResult.groupValues[1], 16).toChar().toString()
|
||||||
}
|
}
|
||||||
@ -43,10 +49,10 @@ open class Odnoklassniki : ExtractorApi() {
|
|||||||
source = this.name,
|
source = this.name,
|
||||||
name = this.name,
|
name = this.name,
|
||||||
url = videoUrl,
|
url = videoUrl,
|
||||||
referer = url,
|
referer = "$mainUrl/",
|
||||||
quality = getQualityFromName(quality),
|
quality = getQualityFromName(quality),
|
||||||
headers = userAgent,
|
headers = headers,
|
||||||
isM3u8 = false
|
isM3u8 = false,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.lagradost.cloudstream3.extractors
|
package com.lagradost.cloudstream3.extractors
|
||||||
|
|
||||||
import com.lagradost.cloudstream3.SubtitleFile
|
import com.lagradost.cloudstream3.SubtitleFile
|
||||||
|
import com.lagradost.cloudstream3.USER_AGENT
|
||||||
import com.lagradost.cloudstream3.app
|
import com.lagradost.cloudstream3.app
|
||||||
import com.lagradost.cloudstream3.utils.*
|
import com.lagradost.cloudstream3.utils.*
|
||||||
|
|
||||||
@ -16,18 +17,22 @@ open class StreamSilk : ExtractorApi() {
|
|||||||
subtitleCallback: (SubtitleFile) -> Unit,
|
subtitleCallback: (SubtitleFile) -> Unit,
|
||||||
callback: (ExtractorLink) -> Unit
|
callback: (ExtractorLink) -> Unit
|
||||||
) {
|
) {
|
||||||
val response = app.get(url, headers = mapOf(
|
val response = app.get(url, headers = mapOf("Accept" to "*/*"))
|
||||||
"Accept" to "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
|
|
||||||
),)
|
|
||||||
response.document.select("script").firstOrNull {
|
response.document.select("script").firstOrNull {
|
||||||
it.html().contains("h,u,n,t,e,r")
|
it.html().contains("h,u,n,t,e,r")
|
||||||
}?.html()?.let { hunted ->
|
}?.html()?.let { hunted ->
|
||||||
JsHunter(hunted).dehunt()?.let { script ->
|
JsHunter(hunted).dehunt()?.let { script ->
|
||||||
srcRegex.find(script)?.groupValues?.get(1)?.trim()?.let { link ->
|
srcRegex.find(script)?.groupValues?.get(1)?.trim()?.let { link ->
|
||||||
|
val headers = mapOf(
|
||||||
|
"Origin" to mainUrl,
|
||||||
|
"Referer" to "$mainUrl/",
|
||||||
|
"User-Agent" to USER_AGENT,
|
||||||
|
)
|
||||||
M3u8Helper.generateM3u8(
|
M3u8Helper.generateM3u8(
|
||||||
name,
|
name,
|
||||||
link,
|
link,
|
||||||
"$mainUrl/"
|
"$mainUrl/",
|
||||||
|
headers = headers
|
||||||
).forEach(callback)
|
).forEach(callback)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,10 @@ class Vidguardto2 : Vidguardto() {
|
|||||||
override val mainUrl = "https://listeamed.net"
|
override val mainUrl = "https://listeamed.net"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class Vidguardto3 : Vidguardto() {
|
||||||
|
override val mainUrl = "https://vgfplay.com"
|
||||||
|
}
|
||||||
|
|
||||||
open class Vidguardto : ExtractorApi() {
|
open class Vidguardto : ExtractorApi() {
|
||||||
override val name = "Vidguard"
|
override val name = "Vidguard"
|
||||||
override val mainUrl = "https://vidguard.to"
|
override val mainUrl = "https://vidguard.to"
|
||||||
|
@ -280,6 +280,7 @@ import com.lagradost.cloudstream3.extractors.VidHidePro6
|
|||||||
import com.lagradost.cloudstream3.extractors.Lulustream1
|
import com.lagradost.cloudstream3.extractors.Lulustream1
|
||||||
import com.lagradost.cloudstream3.extractors.Lulustream2
|
import com.lagradost.cloudstream3.extractors.Lulustream2
|
||||||
import com.lagradost.cloudstream3.extractors.Lulustream3
|
import com.lagradost.cloudstream3.extractors.Lulustream3
|
||||||
|
import com.lagradost.cloudstream3.extractors.Vidguardto3
|
||||||
import com.lagradost.cloudstream3.mvvm.logError
|
import com.lagradost.cloudstream3.mvvm.logError
|
||||||
import com.lagradost.cloudstream3.mvvm.normalSafeApiCall
|
import com.lagradost.cloudstream3.mvvm.normalSafeApiCall
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
@ -967,6 +968,7 @@ val extractorApis: MutableList<ExtractorApi> = arrayListOf(
|
|||||||
Vidguardto(),
|
Vidguardto(),
|
||||||
Vidguardto1(),
|
Vidguardto1(),
|
||||||
Vidguardto2(),
|
Vidguardto2(),
|
||||||
|
Vidguardto3(),
|
||||||
Simpulumlamerop(),
|
Simpulumlamerop(),
|
||||||
Urochsunloath(),
|
Urochsunloath(),
|
||||||
Yipsu(),
|
Yipsu(),
|
||||||
|
Reference in New Issue
Block a user