Skip to content

Commit

Permalink
fix Acefile & Gofile (recloudstream#926)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sofie99 authored Feb 15, 2024
1 parent d1db4c3 commit 012d383
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
24 changes: 12 additions & 12 deletions app/src/main/java/com/lagradost/cloudstream3/extractors/Acefile.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.lagradost.cloudstream3.extractors

import com.lagradost.cloudstream3.SubtitleFile
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.base64Decode
import com.lagradost.cloudstream3.utils.*

open class Acefile : ExtractorApi() {
Expand All @@ -16,22 +15,19 @@ open class Acefile : ExtractorApi() {
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
val script = getAndUnpack(app.get(url).text)
val id = script.substringAfter("\"code\":\"").substringBefore("\",")
val doc = app.get("https://drive.google.com/uc?id=${base64Decode(id)}&export=download").document
val form = doc.select("form#download-form").attr("action")
val uc = doc.select("input#uc-download-link").attr("value")
val video = app.post(
form, data = mapOf(
"uc-download-link" to uc
)
).url
val id = "/(?:d|download|player|f|file)/(\\w+)".toRegex().find(url)?.groupValues?.get(1)
val script = getAndUnpack(app.get("$mainUrl/player/${id ?: return}").text)
val service = """service\s*=\s*['"]([^'"]+)""".toRegex().find(script)?.groupValues?.get(1)
val serverUrl = """['"](\S+check&id\S+?)['"]""".toRegex().find(script)?.groupValues?.get(1)
?.replace("\"+service+\"", service ?: return)

val video = app.get(serverUrl ?: return, referer = "$mainUrl/").parsedSafe<Source>()?.data

callback.invoke(
ExtractorLink(
this.name,
this.name,
video,
video ?: return,
"",
Qualities.Unknown.value,
INFER_TYPE
Expand All @@ -40,4 +36,8 @@ open class Acefile : ExtractorApi() {

}

data class Source(
val data: String? = null,
)

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ open class Gofile : ExtractorApi() {
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 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 {
callback.invoke(
ExtractorLink(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ open class Rabbitstream : ExtractorApi() {

val response = app.get(
"$mainUrl/$embed/getSources?id=$id",
referer = mainUrl,
referer = url,
headers = mapOf("X-Requested-With" to "XMLHttpRequest")
)

Expand All @@ -72,7 +72,7 @@ open class Rabbitstream : ExtractorApi() {
).forEach(callback)
}

decryptedSources?.tracks?.map { track ->
decryptedSources?.tracks?.filter { it?.kind == "captions" }?.map { track ->
subtitleCallback.invoke(
SubtitleFile(
track?.label ?: "",
Expand Down

0 comments on commit 012d383

Please sign in to comment.