mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
Extractor: New extractor VidSrcTo
+ new AnyVidplay extractor which can be used on alternate vidplay domains by AnyVidplay(<new doamin>),getUrl(...)
This commit is contained in:
parent
33e985bfea
commit
47ca5aa5cc
3 changed files with 82 additions and 0 deletions
|
@ -0,0 +1,74 @@
|
||||||
|
package com.lagradost.cloudstream3.extractors
|
||||||
|
|
||||||
|
import android.util.Base64
|
||||||
|
import android.util.Log
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty
|
||||||
|
import com.lagradost.cloudstream3.SubtitleFile
|
||||||
|
import com.lagradost.cloudstream3.apmap
|
||||||
|
import com.lagradost.cloudstream3.app
|
||||||
|
import com.lagradost.cloudstream3.utils.ExtractorApi
|
||||||
|
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||||
|
import java.net.URLDecoder
|
||||||
|
import javax.crypto.Cipher
|
||||||
|
import javax.crypto.spec.SecretKeySpec
|
||||||
|
|
||||||
|
class VidSrcTo : ExtractorApi() {
|
||||||
|
override val name = "VidSrcTo"
|
||||||
|
override val mainUrl = "https://vidsrc.to"
|
||||||
|
override val requiresReferer = true
|
||||||
|
|
||||||
|
override suspend fun getUrl(
|
||||||
|
url: String,
|
||||||
|
referer: String?,
|
||||||
|
subtitleCallback: (SubtitleFile) -> Unit,
|
||||||
|
callback: (ExtractorLink) -> Unit
|
||||||
|
) {
|
||||||
|
val mediaId =
|
||||||
|
app.get(url).document.selectFirst("ul.episodes li a")?.attr("data-id") ?: return
|
||||||
|
val res =
|
||||||
|
app.get("$mainUrl/ajax/embed/episode/$mediaId/sources")
|
||||||
|
.parsedSafe<VidsrctoEpisodeSources>()
|
||||||
|
if (res?.status == 200) {
|
||||||
|
res.result?.apmap { source ->
|
||||||
|
val embedRes =
|
||||||
|
app.get("$mainUrl/ajax/embed/source/${source.id}")
|
||||||
|
.parsedSafe<VidsrctoEmbedSource>()
|
||||||
|
val finalUrl = DecryptUrl(embedRes?.result?.encUrl ?: "")
|
||||||
|
Log.d("rowdyTest", source.title + ": " + finalUrl)
|
||||||
|
when (source.title) {
|
||||||
|
"Vidplay" ->
|
||||||
|
AnyVidplay(finalUrl.substringBefore("/e/"))
|
||||||
|
.getUrl(finalUrl, referer, subtitleCallback, callback)
|
||||||
|
"Filemoon" -> FileMoon().getUrl(finalUrl, referer, subtitleCallback, callback)
|
||||||
|
else -> {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun DecryptUrl(encUrl: String): String {
|
||||||
|
var data = encUrl.toByteArray()
|
||||||
|
data = Base64.decode(data, Base64.URL_SAFE)
|
||||||
|
val rc4Key = SecretKeySpec("WXrUARXb1aDLaZjI".toByteArray(), "RC4")
|
||||||
|
val cipher = Cipher.getInstance("RC4")
|
||||||
|
cipher.init(Cipher.DECRYPT_MODE, rc4Key, cipher.parameters)
|
||||||
|
data = cipher.doFinal(data)
|
||||||
|
return URLDecoder.decode(data.toString(Charsets.UTF_8), "utf-8")
|
||||||
|
}
|
||||||
|
data class VidsrctoEpisodeSources(
|
||||||
|
@JsonProperty("status") val status: Int,
|
||||||
|
@JsonProperty("result") val result: List<VidsrctoResult>?
|
||||||
|
)
|
||||||
|
|
||||||
|
data class VidsrctoResult(
|
||||||
|
@JsonProperty("id") val id: String,
|
||||||
|
@JsonProperty("title") val title: String
|
||||||
|
)
|
||||||
|
|
||||||
|
data class VidsrctoEmbedSource(
|
||||||
|
@JsonProperty("status") val status: Int,
|
||||||
|
@JsonProperty("result") val result: VidsrctoUrl
|
||||||
|
)
|
||||||
|
|
||||||
|
data class VidsrctoUrl(@JsonProperty("url") val encUrl: String)
|
||||||
|
}
|
|
@ -13,6 +13,10 @@ import javax.crypto.spec.SecretKeySpec
|
||||||
// Code found in https://github.com/KillerDogeEmpire/vidplay-keys
|
// Code found in https://github.com/KillerDogeEmpire/vidplay-keys
|
||||||
// special credits to @KillerDogeEmpire for providing key
|
// special credits to @KillerDogeEmpire for providing key
|
||||||
|
|
||||||
|
class AnyVidplay(hostUrl: String) : Vidplay() {
|
||||||
|
override val mainUrl = hostUrl
|
||||||
|
}
|
||||||
|
|
||||||
class MyCloud : Vidplay() {
|
class MyCloud : Vidplay() {
|
||||||
override val name = "MyCloud"
|
override val name = "MyCloud"
|
||||||
override val mainUrl = "https://mcloud.bz"
|
override val mainUrl = "https://mcloud.bz"
|
||||||
|
|
|
@ -10,6 +10,7 @@ import com.lagradost.cloudstream3.extractors.AStreamHub
|
||||||
import com.lagradost.cloudstream3.extractors.Acefile
|
import com.lagradost.cloudstream3.extractors.Acefile
|
||||||
import com.lagradost.cloudstream3.extractors.Ahvsh
|
import com.lagradost.cloudstream3.extractors.Ahvsh
|
||||||
import com.lagradost.cloudstream3.extractors.Aico
|
import com.lagradost.cloudstream3.extractors.Aico
|
||||||
|
import com.lagradost.cloudstream3.extractors.AnyVidplay
|
||||||
import com.lagradost.cloudstream3.extractors.AsianLoad
|
import com.lagradost.cloudstream3.extractors.AsianLoad
|
||||||
import com.lagradost.cloudstream3.extractors.Bestx
|
import com.lagradost.cloudstream3.extractors.Bestx
|
||||||
import com.lagradost.cloudstream3.extractors.Blogger
|
import com.lagradost.cloudstream3.extractors.Blogger
|
||||||
|
@ -182,6 +183,7 @@ import com.lagradost.cloudstream3.extractors.Vanfem
|
||||||
import com.lagradost.cloudstream3.extractors.Vicloud
|
import com.lagradost.cloudstream3.extractors.Vicloud
|
||||||
import com.lagradost.cloudstream3.extractors.VidSrcExtractor
|
import com.lagradost.cloudstream3.extractors.VidSrcExtractor
|
||||||
import com.lagradost.cloudstream3.extractors.VidSrcExtractor2
|
import com.lagradost.cloudstream3.extractors.VidSrcExtractor2
|
||||||
|
import com.lagradost.cloudstream3.extractors.VidSrcTo
|
||||||
import com.lagradost.cloudstream3.extractors.VideoVard
|
import com.lagradost.cloudstream3.extractors.VideoVard
|
||||||
import com.lagradost.cloudstream3.extractors.VideovardSX
|
import com.lagradost.cloudstream3.extractors.VideovardSX
|
||||||
import com.lagradost.cloudstream3.extractors.Vidgomunime
|
import com.lagradost.cloudstream3.extractors.Vidgomunime
|
||||||
|
@ -871,8 +873,10 @@ val extractorApis: MutableList<ExtractorApi> = arrayListOf(
|
||||||
Streamlare(),
|
Streamlare(),
|
||||||
VidSrcExtractor(),
|
VidSrcExtractor(),
|
||||||
VidSrcExtractor2(),
|
VidSrcExtractor2(),
|
||||||
|
VidSrcTo(),
|
||||||
PlayLtXyz(),
|
PlayLtXyz(),
|
||||||
AStreamHub(),
|
AStreamHub(),
|
||||||
|
AnyVidplay("");
|
||||||
Vidplay(),
|
Vidplay(),
|
||||||
VidplayOnline(),
|
VidplayOnline(),
|
||||||
MyCloud(),
|
MyCloud(),
|
||||||
|
|
Loading…
Reference in a new issue