Skip to content

Commit

Permalink
chore(all/lmanime): Change extractors (#2596)
Browse files Browse the repository at this point in the history
Co-authored-by: jmir1 <[email protected]>
  • Loading branch information
Dark25 and jmir1 authored Dec 2, 2023
1 parent 7ad0d28 commit e06a653
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
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

0 comments on commit e06a653

Please sign in to comment.