aniflix: fix issue with one hoster not working
This commit is contained in:
@ -6,7 +6,7 @@ ext {
|
|||||||
extName = 'Aniflix'
|
extName = 'Aniflix'
|
||||||
pkgNameSuffix = 'de.aniflix'
|
pkgNameSuffix = 'de.aniflix'
|
||||||
extClass = '.Aniflix'
|
extClass = '.Aniflix'
|
||||||
extVersionCode = 6
|
extVersionCode = 7
|
||||||
libVersion = '12'
|
libVersion = '12'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,8 +171,10 @@ class Aniflix : ConfigurableAnimeSource, AnimeHttpSource() {
|
|||||||
val hosterSelection = preferences.getStringSet("hoster_selection", null)
|
val hosterSelection = preferences.getStringSet("hoster_selection", null)
|
||||||
when {
|
when {
|
||||||
link.contains("https://dood") && hosterSelection?.contains("dood") == true -> {
|
link.contains("https://dood") && hosterSelection?.contains("dood") == true -> {
|
||||||
val video = DoodExtractor(client).videoFromUrl(link, quality)
|
val video = try { DoodExtractor(client).videoFromUrl(link, quality) } catch (e: Exception) { null }
|
||||||
videoList.add(video)
|
if (video != null) {
|
||||||
|
videoList.add(video)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
link.contains("https://streamtape") && hosterSelection?.contains("stape") == true -> {
|
link.contains("https://streamtape") && hosterSelection?.contains("stape") == true -> {
|
||||||
val video = StreamTapeExtractor(client).videoFromUrl(link, quality)
|
val video = StreamTapeExtractor(client).videoFromUrl(link, quality)
|
||||||
|
@ -5,12 +5,12 @@ import eu.kanade.tachiyomi.network.GET
|
|||||||
import okhttp3.Headers
|
import okhttp3.Headers
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
|
|
||||||
class DoodExtractor(val client: OkHttpClient) {
|
class DoodExtractor(private val client: OkHttpClient) {
|
||||||
fun videoFromUrl(url: String, quality: String): Video {
|
fun videoFromUrl(url: String, quality: String): Video? {
|
||||||
val response = client.newCall(GET(url)).execute()
|
val response = client.newCall(GET(url)).execute()
|
||||||
val doodTld = url.substringAfter("https://dood.").substringBefore("/")
|
val doodTld = url.substringAfter("https://dood.").substringBefore("/")
|
||||||
val content = response.body!!.string()
|
val content = response.body!!.string()
|
||||||
if (!content.contains("'/pass_md5/")) throw Exception("Error with doodstream mirror")
|
if (!content.contains("'/pass_md5/")) return null
|
||||||
val md5 = content.substringAfter("'/pass_md5/").substringBefore("',")
|
val md5 = content.substringAfter("'/pass_md5/").substringBefore("',")
|
||||||
val token = md5.substringAfterLast("/")
|
val token = md5.substringAfterLast("/")
|
||||||
val randomString = getRandomString()
|
val randomString = getRandomString()
|
||||||
|
@ -5,9 +5,8 @@ import eu.kanade.tachiyomi.network.GET
|
|||||||
import eu.kanade.tachiyomi.util.asJsoup
|
import eu.kanade.tachiyomi.util.asJsoup
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
|
|
||||||
class StreamTapeExtractor(val client: OkHttpClient) {
|
class StreamTapeExtractor(private val client: OkHttpClient) {
|
||||||
fun videoFromUrl(url: String, quality: String): Video? {
|
fun videoFromUrl(url: String, quality: String): Video? {
|
||||||
val id = url.substringAfterLast("/")
|
|
||||||
val document = client.newCall(GET(url)).execute().asJsoup()
|
val document = client.newCall(GET(url)).execute().asJsoup()
|
||||||
val script = document.select("script:containsData(document.getElementById('robotlink'))")
|
val script = document.select("script:containsData(document.getElementById('robotlink'))")
|
||||||
.firstOrNull()?.data()?.substringAfter("document.getElementById('robotlink').innerHTML = '")
|
.firstOrNull()?.data()?.substringAfter("document.getElementById('robotlink').innerHTML = '")
|
||||||
|
Reference in New Issue
Block a user