From 2e379e7aafd8d761e98b0ee7f7edc72087da096f Mon Sep 17 00:00:00 2001 From: Zaw <42999156+ImZaw@users.noreply.github.com> Date: Tue, 4 Oct 2022 22:59:41 +0300 Subject: [PATCH] egybest egybest egybest, i hope this will work forever --- EgyBestProvider/build.gradle.kts | 2 +- .../kotlin/com/egybest/EgyBestProvider.kt | 78 +++---------------- 2 files changed, 13 insertions(+), 67 deletions(-) diff --git a/EgyBestProvider/build.gradle.kts b/EgyBestProvider/build.gradle.kts index 99303b3..e04a3b5 100644 --- a/EgyBestProvider/build.gradle.kts +++ b/EgyBestProvider/build.gradle.kts @@ -1,4 +1,4 @@ -version = 4 +version = 5 cloudstream { description = "" diff --git a/EgyBestProvider/src/main/kotlin/com/egybest/EgyBestProvider.kt b/EgyBestProvider/src/main/kotlin/com/egybest/EgyBestProvider.kt index e7415d8..6f2ec8f 100644 --- a/EgyBestProvider/src/main/kotlin/com/egybest/EgyBestProvider.kt +++ b/EgyBestProvider/src/main/kotlin/com/egybest/EgyBestProvider.kt @@ -4,6 +4,7 @@ package com.egybest import com.fasterxml.jackson.annotation.JsonProperty import com.lagradost.cloudstream3.* import com.lagradost.cloudstream3.utils.ExtractorLink +import com.lagradost.cloudstream3.utils.M3u8Helper import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer import com.lagradost.cloudstream3.utils.AppUtils.parseJson import com.lagradost.cloudstream3.utils.Qualities @@ -207,72 +208,17 @@ class EgyBest : MainAPI() { subtitleCallback: (SubtitleFile) -> Unit, callback: (ExtractorLink) -> Unit ): Boolean { - /*val baseURL = data.split("/")[0] + "//" + data.split("/")[2] - - val session = Requests() - val episodeSoup = session.get(data).document - - val vidstreamURL = fixUrlNull(episodeSoup.selectFirst("iframe.auto-size")?.attr("src") ) ?: throw ErrorLoadingException("No iframe") - - val videoSoup = app.get(vidstreamURL).document - fixUrlNull( videoSoup.select("source").firstOrNull { it.hasAttr("src") }?.attr("src"))?.let { - app.get(it).text.replace("#EXTM3U\n","").ExtractLinks() - } ?: run { - var jsCode = videoSoup.select("script")[1].data() - println(jsCode) - val verificationToken = Regex("\\{'[0-9a-zA-Z_]*':'ok'\\}").findAll(jsCode).first().value.replace("\\{'|':.*".toRegex(), "") - val encodedAdLinkVar = Regex("\\([0-9a-zA-Z_]{2,12}\\[Math").findAll(jsCode).first().value.replace("\\(|\\[M.*".toRegex(),"") - val encodingArraysRegEx = Regex(",[0-9a-zA-Z_]{2,12}=\\[\\]").findAll(jsCode).toList() - - val firstEncodingArray = encodingArraysRegEx[1].value.replace(",|=.*".toRegex(),"") - val secondEncodingArray = encodingArraysRegEx[2].value.replace(",|=.*".toRegex(),"") - - jsCode = jsCode.replace("^