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