feat: add earnvids extractors based on vidhide and fix vidhide (#1651)

This commit is contained in:
Bnyro
2025-04-08 21:57:34 +02:00
committed by GitHub
parent 381e3ebf25
commit 18c87c9361
3 changed files with 31 additions and 39 deletions

View File

@ -30,6 +30,20 @@ class VidHidePro6 : VidHidePro() {
override val mainUrl = "https://vidhidepre.com"
}
class Smoothpre: VidHidePro() {
override var name = "EarnVids"
override var mainUrl = "https://smoothpre.com"
}
class Dhtpre: VidHidePro() {
override var name = "EarnVids"
override var mainUrl = "https://dhtpre.com"
}
class Peytonepre : VidHidePro() {
override var name = "EarnVids"
override var mainUrl = "https://peytonepre.com"
}
open class VidHidePro : ExtractorApi() {
override val name = "VidHidePro"
@ -57,15 +71,17 @@ open class VidHidePro : ExtractorApi() {
getAndUnpack(response.text)
} else {
response.document.selectFirst("script:containsData(sources:)")?.data()
} ?: return
// m3u8 urls could be prefixed by 'file:', 'hls2:' or 'hls4:', so we just match ':'
Regex(":\\s*\"(.*?m3u8.*?)\"").findAll(script).forEach { m3u8Match ->
generateM3u8(
name,
m3u8Match.groupValues[1],
mainUrl,
headers = headers
).forEach(callback)
}
val m3u8 =
Regex("file:\\s*\"(.*?m3u8.*?)\"").find(script ?: return)?.groupValues?.getOrNull(1)
generateM3u8(
name,
m3u8 ?: return,
mainUrl,
headers = headers
).forEach(callback)
}
private fun getEmbedUrl(url: String): String {

View File

@ -1,37 +1,7 @@
package com.lagradost.cloudstream3.extractors
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.network.WebViewResolver
import com.lagradost.cloudstream3.utils.ExtractorApi
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.ExtractorLinkType
import com.lagradost.cloudstream3.utils.Qualities
import com.lagradost.cloudstream3.utils.newExtractorLink
open class VidhideExtractor : ExtractorApi() {
open class VidhideExtractor : VidHidePro() {
override var name = "VidHide"
override var mainUrl = "https://vidhide.com"
override val requiresReferer = false
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink>? {
val response = app.get(
url, referer = referer ?: "$mainUrl/", interceptor = WebViewResolver(
Regex("""master\.m3u8""")
)
)
val sources = mutableListOf<ExtractorLink>()
if (response.url.contains("m3u8"))
sources.add(
newExtractorLink(
source = name,
name = name,
url = response.url,
type = ExtractorLinkType.M3U8
) {
this.referer = referer ?: "$mainUrl/"
this.quality = Qualities.Unknown.value
}
)
return sources
}
}

View File

@ -38,6 +38,7 @@ import com.lagradost.cloudstream3.extractors.DesuArcg
import com.lagradost.cloudstream3.extractors.DesuDrive
import com.lagradost.cloudstream3.extractors.DesuOdchan
import com.lagradost.cloudstream3.extractors.DesuOdvip
import com.lagradost.cloudstream3.extractors.Dhtpre
import com.lagradost.cloudstream3.extractors.Dokicloud
import com.lagradost.cloudstream3.extractors.DoodCxExtractor
import com.lagradost.cloudstream3.extractors.DoodLaExtractor
@ -152,6 +153,7 @@ import com.lagradost.cloudstream3.extractors.OkRuHTTP
import com.lagradost.cloudstream3.extractors.OkRuSSL
import com.lagradost.cloudstream3.extractors.Okrulink
import com.lagradost.cloudstream3.extractors.PeaceMakerst
import com.lagradost.cloudstream3.extractors.Peytonepre
import com.lagradost.cloudstream3.extractors.Pichive
import com.lagradost.cloudstream3.extractors.PixelDrain
import com.lagradost.cloudstream3.extractors.PlayLtXyz
@ -178,6 +180,7 @@ import com.lagradost.cloudstream3.extractors.SfastwishCom
import com.lagradost.cloudstream3.extractors.ShaveTape
import com.lagradost.cloudstream3.extractors.SibNet
import com.lagradost.cloudstream3.extractors.Simpulumlamerop
import com.lagradost.cloudstream3.extractors.Smoothpre
import com.lagradost.cloudstream3.extractors.Sobreatsesuyp
import com.lagradost.cloudstream3.extractors.Solidfiles
import com.lagradost.cloudstream3.extractors.Ssbstream
@ -1136,6 +1139,9 @@ val extractorApis: MutableList<ExtractorApi> = arrayListOf(
VidHidePro4(),
VidHidePro5(),
VidHidePro6(),
Dhtpre(),
Smoothpre(),
Peytonepre(),
LuluStream(),
Lulustream1(),
Lulustream2(),