From 5dfc08aabb0cb4b093cc377f44523cf03f8ae095 Mon Sep 17 00:00:00 2001 From: coxju <118901131+coxju@users.noreply.github.com> Date: Thu, 18 Jan 2024 03:58:17 +0530 Subject: [PATCH] feat: added emturbovid extractor (#893) Co-authored-by: coxju --- .../extractors/EmturbovidExtractor.kt | 39 +++++++++++++++++++ .../cloudstream3/utils/ExtractorApi.kt | 4 +- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 app/src/main/java/com/lagradost/cloudstream3/extractors/EmturbovidExtractor.kt diff --git a/app/src/main/java/com/lagradost/cloudstream3/extractors/EmturbovidExtractor.kt b/app/src/main/java/com/lagradost/cloudstream3/extractors/EmturbovidExtractor.kt new file mode 100644 index 00000000..641f13d3 --- /dev/null +++ b/app/src/main/java/com/lagradost/cloudstream3/extractors/EmturbovidExtractor.kt @@ -0,0 +1,39 @@ +package com.lagradost.cloudstream3.extractors + +import com.lagradost.cloudstream3.app +import com.lagradost.cloudstream3.utils.ExtractorApi +import com.lagradost.cloudstream3.utils.ExtractorLink +import com.lagradost.cloudstream3.utils.Qualities + +open class EmturbovidExtractor : ExtractorApi() { + override var name = "Emturbovid" + override var mainUrl = "https://emturbovid.com" + override val requiresReferer = false + + override suspend fun getUrl(url: String, referer: String?): List? { + val response = app.get( + url, referer = referer ?: "$mainUrl/" + ) + val playerScript = + response.document.selectXpath("//script[contains(text(),'var urlPlay')]") + .html() + + val sources = mutableListOf() + if (playerScript.isNotBlank()) { + val m3u8Url = + playerScript.substringAfter("var urlPlay = '").substringBefore("'") + + sources.add( + ExtractorLink( + source = name, + name = name, + url = m3u8Url, + referer = "$mainUrl/", + quality = Qualities.Unknown.value, + isM3u8 = true + ) + ) + } + return sources + } +} \ No newline at end of file diff --git a/app/src/main/java/com/lagradost/cloudstream3/utils/ExtractorApi.kt b/app/src/main/java/com/lagradost/cloudstream3/utils/ExtractorApi.kt index 59417f4d..f47e4ccc 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/utils/ExtractorApi.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/utils/ExtractorApi.kt @@ -103,6 +103,7 @@ import com.lagradost.cloudstream3.extractors.Odnoklassniki import com.lagradost.cloudstream3.extractors.TauVideo import com.lagradost.cloudstream3.extractors.SibNet import com.lagradost.cloudstream3.extractors.ContentX +import com.lagradost.cloudstream3.extractors.EmturbovidExtractor import com.lagradost.cloudstream3.extractors.Hotlinger import com.lagradost.cloudstream3.extractors.FourCX import com.lagradost.cloudstream3.extractors.HDMomPlayer @@ -856,7 +857,8 @@ val extractorApis: MutableList = arrayListOf( Dokicloud(), Megacloud(), VidhideExtractor(), - StreamWishExtractor() + StreamWishExtractor(), + EmturbovidExtractor() )