mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
32 lines
No EOL
1.1 KiB
Kotlin
32 lines
No EOL
1.1 KiB
Kotlin
package com.lagradost.cloudstream3.extractors.helper
|
|
|
|
import android.util.Log
|
|
import com.lagradost.cloudstream3.SubtitleFile
|
|
import com.lagradost.cloudstream3.amap
|
|
import com.lagradost.cloudstream3.app
|
|
import com.lagradost.cloudstream3.utils.ExtractorLink
|
|
import com.lagradost.cloudstream3.utils.loadExtractor
|
|
|
|
class AsianEmbedHelper {
|
|
companion object {
|
|
suspend fun getUrls(
|
|
url: String,
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
callback: (ExtractorLink) -> Unit
|
|
) {
|
|
// Fetch links
|
|
val doc = app.get(url).document
|
|
val links = doc.select("div#list-server-more > ul > li.linkserver")
|
|
if (!links.isNullOrEmpty()) {
|
|
links.amap {
|
|
val datavid = it.attr("data-video") ?: ""
|
|
//Log.i("AsianEmbed", "Result => (datavid) ${datavid}")
|
|
if (datavid.isNotBlank()) {
|
|
val res = loadExtractor(datavid, url, subtitleCallback, callback)
|
|
Log.i("AsianEmbed", "Result => ($res) (datavid) $datavid")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |