removed extractors since its in the app now

This commit is contained in:
Zaw 2022-08-25 15:47:02 +03:00
parent 006a4926dc
commit 740340f5be
10 changed files with 0 additions and 415 deletions

View file

@ -1,10 +0,0 @@
version = 1
cloudstream {
description = ""
authors = listOf( "ImZaw" )
status = 1
tvTypes = listOf( "Others" )
}

View file

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.extractors"/>

View file

@ -1,62 +0,0 @@
package com.extractors
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.utils.ExtractorApi
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.getQualityFromName
class DoodCxExtractor : DoodLaExtractor() {
override var mainUrl = "https://dood.cx"
}
class DoodShExtractor : DoodLaExtractor() {
override var mainUrl = "https://dood.sh"
}
class DoodWatchExtractor : DoodLaExtractor() {
override var mainUrl = "https://dood.watch"
}
class DoodPmExtractor : DoodLaExtractor() {
override var mainUrl = "https://dood.pm"
}
class DoodToExtractor : DoodLaExtractor() {
override var mainUrl = "https://dood.to"
}
class DoodSoExtractor : DoodLaExtractor() {
override var mainUrl = "https://dood.so"
}
class DoodWsExtractor : DoodLaExtractor() {
override var mainUrl = "https://dood.ws"
}
open class DoodLaExtractor : ExtractorApi() {
override var name = "DoodStream"
override var mainUrl = "https://dood.la"
override val requiresReferer = false
override fun getExtractorUrl(id: String): String {
return "$mainUrl/d/$id"
}
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink>? {
val response0 = app.get(url).text // html of DoodStream page to look for /pass_md5/...
val md5 =mainUrl+(Regex("/pass_md5/[^']*").find(response0)?.value ?: return null) // get https://dood.ws/pass_md5/...
val trueUrl = app.get(md5, referer = url).text + "zUEJeL3mUN?token=" + md5.substringAfterLast("/") //direct link to extract (zUEJeL3mUN is random)
val quality = Regex("\\d{3,4}p").find(response0.substringAfter("<title>").substringBefore("</title>"))?.groupValues?.get(0)
return listOf(
ExtractorLink(
trueUrl,
this.name,
trueUrl,
mainUrl,
getQualityFromName(quality),
false
)
) // links are valid in 8h
}
}

View file

@ -1,28 +0,0 @@
package com.extractors
import com.lagradost.cloudstream3.plugins.CloudstreamPlugin
import com.lagradost.cloudstream3.plugins.Plugin
import android.content.Context
@CloudstreamPlugin
class ExtractorPlugin: Plugin() {
override fun load(context: Context) {
registerExtractorAPI(DoodLaExtractor())
registerExtractorAPI(DoodCxExtractor())
registerExtractorAPI(DoodShExtractor())
registerExtractorAPI(DoodWatchExtractor())
registerExtractorAPI(DoodPmExtractor())
registerExtractorAPI(DoodToExtractor())
registerExtractorAPI(DoodSoExtractor())
registerExtractorAPI(DoodWsExtractor())
registerExtractorAPI(Uqload())
registerExtractorAPI(Uqload1())
registerExtractorAPI(StreamTape())
registerExtractorAPI(VoeExtractor())
registerExtractorAPI(JWPlayer())
registerExtractorAPI(VidBom())
registerExtractorAPI(UpstreamExtractor())
registerExtractorAPI(Streamlare())
registerExtractorAPI(Slmaxed())
}
}

View file

@ -1,61 +0,0 @@
package com.extractors
import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson
import com.lagradost.cloudstream3.utils.ExtractorApi
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.Qualities
import com.lagradost.cloudstream3.utils.getQualityFromName
class VidBom : JWPlayer() {
override val name = "Vidbom"
override val mainUrl = "https://vidbam.org"
}
open class JWPlayer : ExtractorApi() {
override val name = "JWPlayer"
override val mainUrl = "https://www.jwplayer.com"
override val requiresReferer = false
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink>? {
val sources = mutableListOf<ExtractorLink>()
with(app.get(url).document) {
val data = this.select("script").mapNotNull { script ->
if (script.data().contains("sources: [")) {
script.data().substringAfter("sources: [")
.substringBefore("],").replace("'", "\"")
} else if (script.data().contains("otakudesu('")) {
script.data().substringAfter("otakudesu('")
.substringBefore("');")
} else {
null
}
}
tryParseJson<List<ResponseSource>>("$data")?.map {
sources.add(
ExtractorLink(
name,
name,
it.file,
referer = url,
quality = getQualityFromName(
Regex("(\\d{3,4}p)").find(it.file)?.groupValues?.get(
1
)
)
)
)
}
}
return sources
}
private data class ResponseSource(
@JsonProperty("file") val file: String,
@JsonProperty("type") val type: String?,
@JsonProperty("label") val label: String?
)
}

View file

@ -1,33 +0,0 @@
package com.extractors
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.utils.ExtractorApi
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.Qualities
class StreamTape : ExtractorApi() {
override var name = "StreamTape"
override var mainUrl = "https://streamtape.com"
override val requiresReferer = false
private val linkRegex =
Regex("""'robotlink'\)\.innerHTML = '(.+?)'\+ \('(.+?)'\)""")
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink>? {
with(app.get(url)) {
linkRegex.find(this.text)?.let {
val extractedUrl = "https:${it.groups[1]!!.value + it.groups[2]!!.value.substring(3,)}"
return listOf(
ExtractorLink(
name,
name,
extractedUrl,
url,
Qualities.Unknown.value,
)
)
}
}
return null
}
}

View file

@ -1,60 +0,0 @@
package com.extractors
import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.utils.ExtractorApi
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.Qualities
import com.lagradost.nicehttp.RequestBodyTypes
import okhttp3.MediaType.Companion.toMediaTypeOrNull
import okhttp3.RequestBody.Companion.toRequestBody
class Streamlare : Slmaxed() {
override val mainUrl = "https://streamlare.com/"
}
open class Slmaxed : ExtractorApi() {
override val name = "Streamlare"
override val mainUrl = "https://slmaxed.com/"
override val requiresReferer = true
// https://slmaxed.com/e/oLvgezw3LjPzbp8E -> oLvgezw3LjPzbp8E
val embedRegex = Regex("""/e/([^/]*)""")
data class JsonResponse(
@JsonProperty val status: String? = null,
@JsonProperty val message: String? = null,
@JsonProperty val type: String? = null,
@JsonProperty val token: String? = null,
@JsonProperty val result: Map<String, Result>? = null
)
data class Result(
@JsonProperty val label: String? = null,
@JsonProperty val file: String? = null,
@JsonProperty val type: String? = null
)
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink>? {
val id = embedRegex.find(url)!!.groupValues[1]
val json = app.post(
"${mainUrl}api/video/stream/get",
requestBody = """{"id":"$id"}""".toRequestBody(RequestBodyTypes.JSON.toMediaTypeOrNull())
).parsed<JsonResponse>()
return json.result?.mapNotNull {
it.value.let { result ->
ExtractorLink(
this.name,
this.name,
result.file ?: return@mapNotNull null,
url,
result.label?.replace("p", "", ignoreCase = true)?.trim()?.toIntOrNull()
?: Qualities.Unknown.value,
isM3u8 = result.type?.contains("hls", ignoreCase = true) == true
)
}
}
}
}

View file

@ -1,59 +0,0 @@
package com.extractors
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.utils.ExtractorApi
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.Qualities
class UpstreamExtractor: ExtractorApi() {
override val name: String = "Upstream.to"
override val mainUrl: String = "https://upstream.to"
override val requiresReferer = true
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink> {
// WIP: m3u8 link fetched but sometimes not playing
//Log.i(this.name, "Result => (no extractor) ${url}")
val sources: MutableList<ExtractorLink> = mutableListOf()
val doc = app.get(url, referer = referer).text
if (doc.isNotBlank()) {
var reg = Regex("(?<=master)(.*)(?=hls)")
val result = reg.find(doc)?.groupValues?.map {
it.trim('|')
}?.toList()
reg = Regex("(?<=\\|file\\|)(.*)(?=\\|remove\\|)")
val domainList = reg.find(doc)?.groupValues?.get(1)?.split("|")
var domain = when (!domainList.isNullOrEmpty()) {
true -> {
if (domainList.isNotEmpty()) {
var domName = ""
for (part in domainList) {
domName = "${part}.${domName}"
}
domName.trimEnd('.')
} else { "" }
}
false -> ""
}
//Log.i(this.name, "Result => (domain) ${domain}")
if (domain.isEmpty()) {
domain = "s96.upstreamcdn.co"
//Log.i(this.name, "Result => (default domain) ${domain}")
}
result?.forEach {
val linkUrl = "https://${domain}/hls/${it}/master.m3u8"
sources.add(
ExtractorLink(
name = "Upstream m3u8",
source = this.name,
url = linkUrl,
quality = Qualities.Unknown.value,
referer = referer ?: linkUrl,
isM3u8 = true
)
)
}
}
return sources
}
}

View file

@ -1,49 +0,0 @@
package com.extractors
import com.lagradost.cloudstream3.utils.*
import com.lagradost.cloudstream3.app
class Uqload1 : Uqload() {
override var mainUrl = "https://uqload.com"
}
open class Uqload : ExtractorApi() {
override val name: String = "Uqload"
override val mainUrl: String = "https://www.uqload.com"
private val srcRegex = Regex("""sources:.\[(.*?)\]""") // would be possible to use the parse and find src attribute
override val requiresReferer = true
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink>? {
val lang = url.substring(0, 2)
val flag =
if (lang == "vo") {
" \uD83C\uDDEC\uD83C\uDDE7"
}
else if (lang == "vf"){
" \uD83C\uDDE8\uD83C\uDDF5"
} else {
""
}
val cleaned_url = if (lang == "ht") { // if url doesn't contain a flag and the url starts with http://
url
} else {
url.substring(2, url.length)
}
with(app.get(cleaned_url)) { // raised error ERROR_CODE_PARSING_CONTAINER_UNSUPPORTED (3003) is due to the response: "error_nofile"
srcRegex.find(this.text)?.groupValues?.get(1)?.replace("\"", "")?.let { link ->
return listOf(
ExtractorLink(
name,
name + flag,
link,
cleaned_url,
Qualities.Unknown.value,
)
)
}
}
return null
}
}

View file

@ -1,51 +0,0 @@
package com.extractors
import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.utils.AppUtils.parseJson
import com.lagradost.cloudstream3.utils.ExtractorApi
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.getQualityFromName
open class VoeExtractor : ExtractorApi() {
override val name: String = "Voe"
override val mainUrl: String = "https://voe.sx"
override val requiresReferer = false
private data class ResponseLinks(
@JsonProperty("hls") val url: String?,
@JsonProperty("video_height") val label: Int?
//val type: String // Mp4
)
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink> {
val extractedLinksList: MutableList<ExtractorLink> = mutableListOf()
val doc = app.get(url).text
if (doc.isNotBlank()) {
val start = "const sources ="
var src = doc.substring(doc.indexOf(start))
src = src.substring(start.length, src.indexOf(";"))
.replace("0,", "0")
.trim()
//Log.i(this.name, "Result => (src) ${src}")
parseJson<ResponseLinks?>(src)?.let { voelink ->
//Log.i(this.name, "Result => (voelink) ${voelink}")
val linkUrl = voelink.url
val linkLabel = voelink.label?.toString() ?: ""
if (!linkUrl.isNullOrEmpty()) {
extractedLinksList.add(
ExtractorLink(
name = this.name,
source = this.name,
url = linkUrl,
quality = getQualityFromName(linkLabel),
referer = url,
isM3u8 = true
)
)
}
}
}
return extractedLinksList
}
}