Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: change extractors #2596

Merged
merged 13 commits into from
Dec 2, 2023
3 changes: 2 additions & 1 deletion multisrc/overrides/animestream/lmanime/additional.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
dependencies {
implementation(project(":lib-dailymotion-extractor"))
implementation(project(":lib-okru-extractor"))
implementation(project(":lib-mp4upload-extractor"))
implementation(project(":lib-streamwish-extractor"))
}
14 changes: 9 additions & 5 deletions multisrc/overrides/animestream/lmanime/src/LMAnime.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import androidx.preference.MultiSelectListPreference
import androidx.preference.PreferenceScreen
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.mp4uploadextractor.Mp4uploadExtractor
import eu.kanade.tachiyomi.lib.streamwishextractor.StreamWishExtractor
import eu.kanade.tachiyomi.multisrc.animestream.AnimeStream
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.Response
Expand Down Expand Up @@ -33,14 +34,17 @@ class LMAnime : AnimeStream(
}.flatten().ifEmpty { throw Exception("Empty video list!") }
}

private val okruExtractor by lazy { OkruExtractor(client) }
private val streamwishExtractor by lazy { StreamWishExtractor(client, headers) }
private val dailyExtractor by lazy { DailymotionExtractor(client, headers) }
private val mp4uploadExtractor by lazy { Mp4uploadExtractor(client) }

override fun getVideoList(url: String, name: String): List<Video> {
val prefix = "$name -"
val prefix = "($name) - "
return when {
"ok.ru" in url -> okruExtractor.videosFromUrl(url, prefix)
"dailymotion.com" in url -> dailyExtractor.videosFromUrl(url, "Dailymotion ($name)")
"dailymotion" in url -> dailyExtractor.videosFromUrl(url, "Dailymotion ($name)")
"mp4upload" in url -> mp4uploadExtractor.videosFromUrl(url, headers, "$prefix")
"filelions" in url -> streamwishExtractor.videosFromUrl(url, "StreamWish ($name)")

else -> emptyList()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class AnimeStreamGenerator : ThemeSourceGenerator {
SingleLang("ChineseAnime", "https://chineseanime.top", "all", isNsfw = false, overrideVersionCode = 3),
SingleLang("desu-online", "https://desu-online.pl", "pl", className = "DesuOnline", isNsfw = false, overrideVersionCode = 3),
SingleLang("DonghuaStream", "https://donghuastream.co.in", "en", isNsfw = false, overrideVersionCode = 2),
SingleLang("LMAnime", "https://lmanime.com", "all", isNsfw = false, overrideVersionCode = 4),
SingleLang("LMAnime", "https://lmanime.com", "all", isNsfw = false, overrideVersionCode = 5),
SingleLang("LuciferDonghua", "https://luciferdonghua.in", "en", isNsfw = false, overrideVersionCode = 3),
SingleLang("MiniOppai", "https://minioppai.org", "id", isNsfw = true, overrideVersionCode = 3),
SingleLang("RineCloud", "https://rine.cloud", "pt-BR", isNsfw = false, overrideVersionCode = 3),
Expand Down