add Aniflix Voe Extractor (#624)
* add Aniflix Voe Extractor Second attempt. Made a mistake in the first Pull Request * Update Aniflix.kt
This commit is contained in:
@ -12,6 +12,7 @@ import eu.kanade.tachiyomi.animeextension.de.aniflix.dto.Release
|
|||||||
import eu.kanade.tachiyomi.animeextension.de.aniflix.dto.Season
|
import eu.kanade.tachiyomi.animeextension.de.aniflix.dto.Season
|
||||||
import eu.kanade.tachiyomi.animeextension.de.aniflix.extractors.DoodExtractor
|
import eu.kanade.tachiyomi.animeextension.de.aniflix.extractors.DoodExtractor
|
||||||
import eu.kanade.tachiyomi.animeextension.de.aniflix.extractors.StreamTapeExtractor
|
import eu.kanade.tachiyomi.animeextension.de.aniflix.extractors.StreamTapeExtractor
|
||||||
|
import eu.kanade.tachiyomi.animeextension.de.aniflix.extractors.VoeExtractor
|
||||||
import eu.kanade.tachiyomi.animesource.ConfigurableAnimeSource
|
import eu.kanade.tachiyomi.animesource.ConfigurableAnimeSource
|
||||||
import eu.kanade.tachiyomi.animesource.model.AnimeFilterList
|
import eu.kanade.tachiyomi.animesource.model.AnimeFilterList
|
||||||
import eu.kanade.tachiyomi.animesource.model.AnimesPage
|
import eu.kanade.tachiyomi.animesource.model.AnimesPage
|
||||||
@ -193,7 +194,7 @@ class Aniflix : ConfigurableAnimeSource, AnimeHttpSource() {
|
|||||||
for (stream in streams) {
|
for (stream in streams) {
|
||||||
val quality = "${stream.hoster?.name}, ${stream.lang}"
|
val quality = "${stream.hoster?.name}, ${stream.lang}"
|
||||||
val link = stream.link ?: return emptyList()
|
val link = stream.link ?: return emptyList()
|
||||||
val hosterSelection = preferences.getStringSet("hoster_selection", setOf("dood", "stape"))
|
val hosterSelection = preferences.getStringSet("hoster_selection", setOf("dood", "stape", "voe"))
|
||||||
when {
|
when {
|
||||||
link.contains("https://dood") && hosterSelection?.contains("dood") == true -> {
|
link.contains("https://dood") && hosterSelection?.contains("dood") == true -> {
|
||||||
val video = try { DoodExtractor(client).videoFromUrl(link, quality) } catch (e: Exception) { null }
|
val video = try { DoodExtractor(client).videoFromUrl(link, quality) } catch (e: Exception) { null }
|
||||||
@ -207,6 +208,12 @@ class Aniflix : ConfigurableAnimeSource, AnimeHttpSource() {
|
|||||||
videoList.add(video)
|
videoList.add(video)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
link.contains("https://voe.sx") && hosterSelection?.contains("voe") == true -> {
|
||||||
|
val video = VoeExtractor(client).videoFromUrl(link, quality)
|
||||||
|
if (video != null) {
|
||||||
|
videoList.add(video)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return videoList
|
return videoList
|
||||||
@ -250,8 +257,8 @@ class Aniflix : ConfigurableAnimeSource, AnimeHttpSource() {
|
|||||||
val hosterPref = ListPreference(screen.context).apply {
|
val hosterPref = ListPreference(screen.context).apply {
|
||||||
key = "preferred_hoster"
|
key = "preferred_hoster"
|
||||||
title = "Standard-Hoster"
|
title = "Standard-Hoster"
|
||||||
entries = arrayOf("Streamtape", "Doodstream")
|
entries = arrayOf("Streamtape", "Doodstream", "Voe")
|
||||||
entryValues = arrayOf("https://streamtape.com", "https://dood")
|
entryValues = arrayOf("https://streamtape.com", "https://dood", "https://voe.sx")
|
||||||
setDefaultValue("https://streamtape.com")
|
setDefaultValue("https://streamtape.com")
|
||||||
summary = "%s"
|
summary = "%s"
|
||||||
|
|
||||||
@ -280,9 +287,9 @@ class Aniflix : ConfigurableAnimeSource, AnimeHttpSource() {
|
|||||||
val subSelection = MultiSelectListPreference(screen.context).apply {
|
val subSelection = MultiSelectListPreference(screen.context).apply {
|
||||||
key = "hoster_selection"
|
key = "hoster_selection"
|
||||||
title = "Hoster auswählen"
|
title = "Hoster auswählen"
|
||||||
entries = arrayOf("Streamtape", "Doodstream")
|
entries = arrayOf("Streamtape", "Doodstream", "Voe")
|
||||||
entryValues = arrayOf("stape", "dood")
|
entryValues = arrayOf("stape", "dood", "voe")
|
||||||
setDefaultValue(setOf("stape", "dood"))
|
setDefaultValue(setOf("stape", "dood", "voe"))
|
||||||
|
|
||||||
setOnPreferenceChangeListener { _, newValue ->
|
setOnPreferenceChangeListener { _, newValue ->
|
||||||
preferences.edit().putStringSet(key, newValue as Set<String>).commit()
|
preferences.edit().putStringSet(key, newValue as Set<String>).commit()
|
||||||
|
@ -0,0 +1,17 @@
|
|||||||
|
package eu.kanade.tachiyomi.animeextension.de.aniflix.extractors
|
||||||
|
|
||||||
|
import eu.kanade.tachiyomi.animesource.model.Video
|
||||||
|
import eu.kanade.tachiyomi.network.GET
|
||||||
|
import eu.kanade.tachiyomi.util.asJsoup
|
||||||
|
import okhttp3.OkHttpClient
|
||||||
|
|
||||||
|
class VoeExtractor(private val client: OkHttpClient) {
|
||||||
|
|
||||||
|
fun videoFromUrl(url: String, quality: String): Video? {
|
||||||
|
val document = client.newCall(GET(url)).execute().asJsoup()
|
||||||
|
val script = document.select("script:containsData(function d04ad2e48229ae25a282e15c7c2f69a2(dea04c5949242bfd216e35def894b930))")
|
||||||
|
.firstOrNull()?.data()?.substringAfter("\"hls\": \"") ?: return null
|
||||||
|
val videoUrl = script.substringAfter("\"hls\": \"").substringBefore("\",")
|
||||||
|
return Video(url, quality, videoUrl, null)
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user