package com.lagradost import com.lagradost.cloudstream3.app import com.lagradost.cloudstream3.utils.ExtractorApi import com.lagradost.cloudstream3.utils.ExtractorLink import com.lagradost.cloudstream3.utils.getQualityFromName open class DoodStreamExtractor : ExtractorApi() { override var name = "DoodStream" override var mainUrl = "https://doodstream.com" override val requiresReferer = false override fun getExtractorUrl(id: String): String { return "$mainUrl/d/$id" } override suspend fun getUrl(url: String, referer: String?): List? { 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("").substringBefore(""))?.groupValues?.get(0) return listOf( ExtractorLink( trueUrl, this.name, trueUrl, mainUrl, getQualityFromName(quality), false ) ) // links are valid in 8h } }