mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
added Mediafire (#906)
This commit is contained in:
parent
01f21e0fe8
commit
8b14fcb881
3 changed files with 46 additions and 1 deletions
|
@ -230,7 +230,7 @@ dependencies {
|
||||||
// Downloading & Networking
|
// Downloading & Networking
|
||||||
implementation("androidx.work:work-runtime:2.8.1")
|
implementation("androidx.work:work-runtime:2.8.1")
|
||||||
implementation("androidx.work:work-runtime-ktx:2.8.1")
|
implementation("androidx.work:work-runtime-ktx:2.8.1")
|
||||||
implementation("com.github.Blatzar:NiceHttp:0.4.4") // HTTP Lib
|
implementation("com.github.Blatzar:NiceHttp:0.4.5") // HTTP Lib
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.register("androidSourcesJar", Jar::class) {
|
tasks.register("androidSourcesJar", Jar::class) {
|
||||||
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
package com.lagradost.cloudstream3.extractors
|
||||||
|
|
||||||
|
import com.lagradost.cloudstream3.SubtitleFile
|
||||||
|
import com.lagradost.cloudstream3.app
|
||||||
|
import com.lagradost.cloudstream3.utils.ExtractorApi
|
||||||
|
import com.lagradost.cloudstream3.utils.ExtractorLink
|
||||||
|
import com.lagradost.cloudstream3.utils.INFER_TYPE
|
||||||
|
import com.lagradost.cloudstream3.utils.Qualities
|
||||||
|
|
||||||
|
open class Mediafire : ExtractorApi() {
|
||||||
|
override val name = "Mediafire"
|
||||||
|
override val mainUrl = "https://www.mediafire.com"
|
||||||
|
override val requiresReferer = true
|
||||||
|
|
||||||
|
override suspend fun getUrl(
|
||||||
|
url: String,
|
||||||
|
referer: String?,
|
||||||
|
subtitleCallback: (SubtitleFile) -> Unit,
|
||||||
|
callback: (ExtractorLink) -> Unit
|
||||||
|
) {
|
||||||
|
val res = app.get(url, referer = referer).document
|
||||||
|
val title = res.select("div.dl-btn-label").text()
|
||||||
|
val video = res.selectFirst("a#downloadButton")?.attr("href")
|
||||||
|
|
||||||
|
callback.invoke(
|
||||||
|
ExtractorLink(
|
||||||
|
this.name,
|
||||||
|
this.name,
|
||||||
|
video ?: return,
|
||||||
|
"",
|
||||||
|
getQuality(title),
|
||||||
|
INFER_TYPE
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun getQuality(str: String?): Int {
|
||||||
|
return Regex("(\\d{3,4})[pP]").find(str ?: "")?.groupValues?.getOrNull(1)?.toIntOrNull()
|
||||||
|
?: Qualities.Unknown.value
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -116,6 +116,7 @@ import com.lagradost.cloudstream3.extractors.TRsTX
|
||||||
import com.lagradost.cloudstream3.extractors.VidMoxy
|
import com.lagradost.cloudstream3.extractors.VidMoxy
|
||||||
import com.lagradost.cloudstream3.extractors.PixelDrain
|
import com.lagradost.cloudstream3.extractors.PixelDrain
|
||||||
import com.lagradost.cloudstream3.extractors.MailRu
|
import com.lagradost.cloudstream3.extractors.MailRu
|
||||||
|
import com.lagradost.cloudstream3.extractors.Mediafire
|
||||||
import com.lagradost.cloudstream3.extractors.OkRuSSL
|
import com.lagradost.cloudstream3.extractors.OkRuSSL
|
||||||
import com.lagradost.cloudstream3.extractors.OkRuHTTP
|
import com.lagradost.cloudstream3.extractors.OkRuHTTP
|
||||||
import com.lagradost.cloudstream3.extractors.Okrulink
|
import com.lagradost.cloudstream3.extractors.Okrulink
|
||||||
|
@ -835,6 +836,7 @@ val extractorApis: MutableList<ExtractorApi> = arrayListOf(
|
||||||
Gdriveplayer(),
|
Gdriveplayer(),
|
||||||
DatabaseGdrive(),
|
DatabaseGdrive(),
|
||||||
DatabaseGdrive2(),
|
DatabaseGdrive2(),
|
||||||
|
Mediafire(),
|
||||||
|
|
||||||
YoutubeExtractor(),
|
YoutubeExtractor(),
|
||||||
YoutubeShortLinkExtractor(),
|
YoutubeShortLinkExtractor(),
|
||||||
|
|
Loading…
Reference in a new issue