fix(en/luciferdonghua): Fix video urls and add filelions (#2317)
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
dependencies {
|
||||
implementation(project(':lib-dailymotion-extractor'))
|
||||
implementation(project(':lib-okru-extractor'))
|
||||
implementation(project(':lib-streamwish-extractor'))
|
||||
}
|
||||
|
@ -4,7 +4,11 @@ import android.util.Base64
|
||||
import eu.kanade.tachiyomi.animesource.model.Video
|
||||
import eu.kanade.tachiyomi.lib.dailymotionextractor.DailymotionExtractor
|
||||
import eu.kanade.tachiyomi.lib.okruextractor.OkruExtractor
|
||||
import eu.kanade.tachiyomi.lib.streamwishextractor.StreamWishExtractor
|
||||
import eu.kanade.tachiyomi.multisrc.animestream.AnimeStream
|
||||
import eu.kanade.tachiyomi.network.GET
|
||||
import eu.kanade.tachiyomi.util.asJsoup
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
|
||||
import org.jsoup.Jsoup
|
||||
|
||||
class LuciferDonghua : AnimeStream(
|
||||
@ -15,28 +19,28 @@ class LuciferDonghua : AnimeStream(
|
||||
// ============================ Video Links =============================
|
||||
|
||||
override fun getHosterUrl(encodedData: String): String {
|
||||
val doc = Base64.decode(encodedData, Base64.DEFAULT)
|
||||
val doc = if (encodedData.toHttpUrlOrNull() == null) {
|
||||
Base64.decode(encodedData, Base64.DEFAULT)
|
||||
.let(::String) // bytearray -> string
|
||||
.let(Jsoup::parse) // string -> document
|
||||
|
||||
val url = doc.selectFirst("iframe[src~=.]")?.attr("src")
|
||||
?: doc.selectFirst("meta[content~=.][itemprop=embedUrl]")!!.attr("content")
|
||||
|
||||
return when {
|
||||
url.startsWith("http") -> url
|
||||
else -> "https:$url"
|
||||
} else {
|
||||
client.newCall(GET(encodedData, headers)).execute().use { it.asJsoup() }
|
||||
}
|
||||
|
||||
return doc.selectFirst("iframe[src~=.]")?.attr("abs:src")
|
||||
?: doc.selectFirst("meta[content~=.][itemprop=embedUrl]")!!.attr("abs:content")
|
||||
}
|
||||
|
||||
private val okruExtractor by lazy { OkruExtractor(client) }
|
||||
private val dailymotionExtractor by lazy { DailymotionExtractor(client, headers) }
|
||||
private val filelionsExtractor by lazy { StreamWishExtractor(client, headers) }
|
||||
|
||||
override fun getVideoList(url: String, name: String): List<Video> {
|
||||
val prefix = "$name - "
|
||||
return when {
|
||||
url.contains("ok.ru") -> {
|
||||
OkruExtractor(client).videosFromUrl(url, prefix = prefix)
|
||||
}
|
||||
url.contains("dailymotion") -> {
|
||||
DailymotionExtractor(client, headers).videosFromUrl(url, prefix)
|
||||
}
|
||||
url.contains("ok.ru") -> okruExtractor.videosFromUrl(url, prefix = prefix)
|
||||
url.contains("dailymotion") -> dailymotionExtractor.videosFromUrl(url, prefix)
|
||||
url.contains("filelions") -> filelionsExtractor.videosFromUrl(url, videoNameGen = { quality -> "FileLions - $quality" })
|
||||
else -> emptyList()
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ class AnimeStreamGenerator : ThemeSourceGenerator {
|
||||
SingleLang("DonghuaStream", "https://donghuastream.co.in", "en", isNsfw = false),
|
||||
SingleLang("Hstream", "https://hstream.moe", "en", isNsfw = true, overrideVersionCode = 3),
|
||||
SingleLang("LMAnime", "https://lmanime.com", "all", isNsfw = false, overrideVersionCode = 3),
|
||||
SingleLang("LuciferDonghua", "https://luciferdonghua.in", "en", isNsfw = false, overrideVersionCode = 1),
|
||||
SingleLang("LuciferDonghua", "https://luciferdonghua.in", "en", isNsfw = false, overrideVersionCode = 2),
|
||||
SingleLang("MiniOppai", "https://minioppai.org", "id", isNsfw = true, overrideVersionCode = 2),
|
||||
SingleLang("RineCloud", "https://rine.cloud", "pt-BR", isNsfw = false, overrideVersionCode = 1),
|
||||
SingleLang("TRAnimeCI", "https://tranimeci.com", "tr", isNsfw = false),
|
||||
|
Reference in New Issue
Block a user