Added Zorofile (extractor)

This commit is contained in:
hexated 2022-08-24 07:23:52 +07:00
parent 82d416ad7f
commit 9301aec0df
3 changed files with 83 additions and 0 deletions

View file

@ -7,6 +7,10 @@ import com.lagradost.cloudstream3.utils.ExtractorApi
import com.lagradost.cloudstream3.utils.ExtractorLink import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.M3u8Helper import com.lagradost.cloudstream3.utils.M3u8Helper
class Sbthe : StreamSB() {
override var mainUrl = "https://sbthe.com"
}
class Ssbstream : StreamSB() { class Ssbstream : StreamSB() {
override var mainUrl = "https://ssbstream.net" override var mainUrl = "https://ssbstream.net"
} }

View file

@ -0,0 +1,77 @@
package com.lagradost.cloudstream3.extractors
import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.APIHolder
import com.lagradost.cloudstream3.ErrorLoadingException
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.utils.AppUtils
import com.lagradost.cloudstream3.utils.ExtractorApi
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.M3u8Helper
class Zorofile : ExtractorApi() {
override val name = "Zorofile"
override val mainUrl = "https://zorofile.com"
override val requiresReferer = true
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink> {
val id = url.split("?").first().split("/").last()
val token = app.get(
url,
referer = referer
).document.select("button.g-recaptcha").attr("data-sitekey").let { captchaKey ->
APIHolder.getCaptchaToken(
url,
captchaKey,
referer = referer
)
} ?: throw ErrorLoadingException("can't bypass captcha")
val sources = mutableListOf<ExtractorLink>()
val data = app.post(
"$mainUrl/dl",
data = mapOf(
"op" to "embed",
"file_code" to id,
"auto" to "1",
"referer" to "$referer/",
"g-recaptcha-response" to token
),
referer = url,
headers = mapOf(
"Accept" to "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
// "Accept-Encoding" to "gzip, deflate, br",
// "Accept-Language" to "en-US,en;q=0.5",
// "Connection" to "keep-alive",
"Content-Length" to "626",
"Content-Type" to "application/x-www-form-urlencoded",
"Origin" to mainUrl,
"Sec-Fetch-Dest" to "iframe",
"Sec-Fetch-Mode" to "navigate",
"Sec-Fetch-Site" to "same-origin",
"Sec-Fetch-User" to "?1",
"Upgrade-Insecure-Requests" to "1",
)
).document.select("script").find { it.data().contains("var holaplayer;") }?.data()
?.substringAfter("sources: [")?.substringBefore("],")?.replace("src", "\"src\"")
?.replace("type", "\"type\"")
AppUtils.tryParseJson<Sources>("$data")?.let { res ->
M3u8Helper.generateM3u8(
name,
res.src ?: return@let,
"$mainUrl/",
headers = mapOf(
"Origin" to mainUrl,
)
).forEach { m3uData -> sources.add(m3uData) }
}
return sources
}
private data class Sources(
@JsonProperty("src") val src: String? = null,
@JsonProperty("type") val type: String? = null,
)
}

View file

@ -234,6 +234,7 @@ val extractorApis: MutableList<ExtractorApi> = arrayListOf(
// Streamhub(), cause Streamhub2() works // Streamhub(), cause Streamhub2() works
Streamhub2(), Streamhub2(),
Ssbstream(), Ssbstream(),
Sbthe(),
Fastream(), Fastream(),
@ -312,6 +313,7 @@ val extractorApis: MutableList<ExtractorApi> = arrayListOf(
Linkbox(), Linkbox(),
Acefile(), Acefile(),
SpeedoStream(), SpeedoStream(),
Zorofile(),
YoutubeExtractor(), YoutubeExtractor(),
YoutubeShortLinkExtractor(), YoutubeShortLinkExtractor(),