[Sora] fixed Gdbot again :*:

This commit is contained in:
hexated 2022-12-20 22:24:47 +07:00
parent 2c7860dd99
commit 95b2dbfe9a
4 changed files with 27 additions and 10 deletions

View file

@ -1,5 +1,5 @@
// use an integer for version numbers
version = 59
version = 60
cloudstream {

View file

@ -1340,7 +1340,7 @@ object SoraExtractor : SoraStream() {
iframe.apmap { (iframeLink, title) ->
val size = Regex("(?i)\\s(\\S+gb|mb)").find(title)?.groupValues?.getOrNull(1)
val gdBotLink = extractGdbot(iframeLink)
val videoLink = extractDrivebot(gdBotLink ?: return@apmap null)
val videoLink = extractGdflix(gdBotLink ?: return@apmap null)
callback.invoke(
ExtractorLink(
@ -1391,7 +1391,7 @@ object SoraExtractor : SoraStream() {
val videoLink = when {
type.contains("gdtot") -> {
val gdBotLink = extractGdbot(fdLink ?: return@apmap null)
extractDrivebot(gdBotLink ?: return@apmap null)
extractGdflix(gdBotLink ?: return@apmap null)
}
type.contains("oiya") -> {
extractOiya(fdLink ?: return@apmap null, qualities)

View file

@ -67,7 +67,7 @@ open class SoraStream : TmdbProvider() {
const val databaseGdriveAPI = "https://databasegdriveplayer.co"
const val hdMovieBoxAPI = "https://hdmoviebox.net"
const val series9API = "https://series9.la"
const val idlixAPI = "https://88.210.12.206"
const val idlixAPI = "https://idlixian.com"
const val noverseAPI = "https://www.nollyverse.com"
const val olgplyAPI = "https://olgply.xyz"
const val uniqueStreamAPI = "https://uniquestream.net"

View file

@ -164,15 +164,32 @@ suspend fun extractDirectDl(url: String): String? {
}
suspend fun extractDrivebot(url: String): String? {
val iframeGdbot =
app.get(url).document.selectFirst("li.flex.flex-col.py-6 a:contains(Drivebot)")
?.attr("href")
val driveDoc = app.get(iframeGdbot ?: return null)
val iframeDrivebot = app.get(url).document.selectFirst("li.flex.flex-col.py-6 a:contains(Drivebot)")
?.attr("href") ?: return null
return getDrivebotLink(iframeDrivebot)
}
suspend fun extractGdflix(url: String): String? {
val iframeGdflix = app.get(url).document.selectFirst("li.flex.flex-col.py-6 a:contains(GDFlix Direct)")
?.attr("href") ?: return null
val base = getBaseUrl(iframeGdflix)
val gdfDoc = app.get(iframeGdflix).document.selectFirst("script")?.data()?.substringAfter("replace(\"")
?.substringBefore("\")")?.let {
app.get(fixUrl(it, base)).document
}
val iframeDrivebot2 = gdfDoc?.selectFirst("a.btn.btn-outline-warning")?.attr("href")
return getDrivebotLink(iframeDrivebot2)
}
suspend fun getDrivebotLink(url: String?): String? {
val driveDoc = app.get(url ?: return null)
val ssid = driveDoc.cookies["PHPSESSID"]
val script = driveDoc.document.selectFirst("script:containsData(var formData)")?.data()
val baseUrl = getBaseUrl(iframeGdbot)
val baseUrl = getBaseUrl(url)
val token = script?.substringAfter("'token', '")?.substringBefore("');")
val link =
script?.substringAfter("fetch('")?.substringBefore("',").let { "$baseUrl$it" }
@ -191,7 +208,7 @@ suspend fun extractDrivebot(url: String): String? {
"Sec-Fetch-Site" to "same-origin"
),
cookies = cookies,
referer = iframeGdbot
referer = url
).text
return tryParseJson<DriveBotLink>(result)?.url
}