fix Acefile & Gofile (#926)

This commit is contained in:
Sofie 2024-02-16 03:42:47 +07:00 committed by GitHub
parent d1db4c3370
commit 012d38398e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 16 additions and 16 deletions

View file

@ -2,7 +2,6 @@ package com.lagradost.cloudstream3.extractors
import com.lagradost.cloudstream3.SubtitleFile import com.lagradost.cloudstream3.SubtitleFile
import com.lagradost.cloudstream3.app import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.base64Decode
import com.lagradost.cloudstream3.utils.* import com.lagradost.cloudstream3.utils.*
open class Acefile : ExtractorApi() { open class Acefile : ExtractorApi() {
@ -16,22 +15,19 @@ open class Acefile : ExtractorApi() {
subtitleCallback: (SubtitleFile) -> Unit, subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit callback: (ExtractorLink) -> Unit
) { ) {
val script = getAndUnpack(app.get(url).text) val id = "/(?:d|download|player|f|file)/(\\w+)".toRegex().find(url)?.groupValues?.get(1)
val id = script.substringAfter("\"code\":\"").substringBefore("\",") val script = getAndUnpack(app.get("$mainUrl/player/${id ?: return}").text)
val doc = app.get("https://drive.google.com/uc?id=${base64Decode(id)}&export=download").document val service = """service\s*=\s*['"]([^'"]+)""".toRegex().find(script)?.groupValues?.get(1)
val form = doc.select("form#download-form").attr("action") val serverUrl = """['"](\S+check&id\S+?)['"]""".toRegex().find(script)?.groupValues?.get(1)
val uc = doc.select("input#uc-download-link").attr("value") ?.replace("\"+service+\"", service ?: return)
val video = app.post(
form, data = mapOf( val video = app.get(serverUrl ?: return, referer = "$mainUrl/").parsedSafe<Source>()?.data
"uc-download-link" to uc
)
).url
callback.invoke( callback.invoke(
ExtractorLink( ExtractorLink(
this.name, this.name,
this.name, this.name,
video, video ?: return,
"", "",
Qualities.Unknown.value, Qualities.Unknown.value,
INFER_TYPE INFER_TYPE
@ -40,4 +36,8 @@ open class Acefile : ExtractorApi() {
} }
data class Source(
val data: String? = null,
)
} }

View file

@ -22,9 +22,9 @@ open class Gofile : ExtractorApi() {
val id = Regex("/(?:\\?c=|d/)([\\da-zA-Z-]+)").find(url)?.groupValues?.get(1) val id = Regex("/(?:\\?c=|d/)([\\da-zA-Z-]+)").find(url)?.groupValues?.get(1)
val token = app.get("$mainApi/createAccount").parsedSafe<Account>()?.data?.get("token") val token = app.get("$mainApi/createAccount").parsedSafe<Account>()?.data?.get("token")
val websiteToken = app.get("$mainUrl/dist/js/alljs.js").text.let { val websiteToken = app.get("$mainUrl/dist/js/alljs.js").text.let {
Regex("websiteToken\\s*=\\s*\"([^\"]+)").find(it)?.groupValues?.get(1) Regex("fetchData.wt\\s*=\\s*\"([^\"]+)").find(it)?.groupValues?.get(1)
} }
app.get("$mainApi/getContent?contentId=$id&token=$token&websiteToken=$websiteToken") app.get("$mainApi/getContent?contentId=$id&token=$token&wt=$websiteToken")
.parsedSafe<Source>()?.data?.contents?.forEach { .parsedSafe<Source>()?.data?.contents?.forEach {
callback.invoke( callback.invoke(
ExtractorLink( ExtractorLink(

View file

@ -47,7 +47,7 @@ open class Rabbitstream : ExtractorApi() {
val response = app.get( val response = app.get(
"$mainUrl/$embed/getSources?id=$id", "$mainUrl/$embed/getSources?id=$id",
referer = mainUrl, referer = url,
headers = mapOf("X-Requested-With" to "XMLHttpRequest") headers = mapOf("X-Requested-With" to "XMLHttpRequest")
) )
@ -72,7 +72,7 @@ open class Rabbitstream : ExtractorApi() {
).forEach(callback) ).forEach(callback)
} }
decryptedSources?.tracks?.map { track -> decryptedSources?.tracks?.filter { it?.kind == "captions" }?.map { track ->
subtitleCallback.invoke( subtitleCallback.invoke(
SubtitleFile( SubtitleFile(
track?.label ?: "", track?.label ?: "",