Skip to content

Commit

Permalink
fix(pt/animeplayer): Fix video extractor (#2418)
Browse files Browse the repository at this point in the history
  • Loading branch information
Claudemirovsky authored Oct 26, 2023
1 parent 6cc22da commit 81909af
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions multisrc/overrides/dooplay/animeplayer/src/AnimePlayer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import eu.kanade.tachiyomi.lib.bloggerextractor.BloggerExtractor
import eu.kanade.tachiyomi.multisrc.dooplay.DooPlay
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
import okhttp3.Response

class AnimePlayer : DooPlay(
Expand All @@ -28,9 +29,17 @@ class AnimePlayer : DooPlay(
override val prefQualityValues = arrayOf("360p", "720p")
override val prefQualityEntries = prefQualityValues

private val bloggerExtractor by lazy { BloggerExtractor(client) }

override fun videoListParse(response: Response): List<Video> {
val player = response.asJsoup().selectFirst("div.playex iframe") ?: return emptyList()
return BloggerExtractor(client).videosFromUrl(player.attr("src"), headers)
val playerUrl = response.use { it.asJsoup() }
.selectFirst("div.playex iframe")
?.attr("abs:src")
?.toHttpUrlOrNull()
?: return emptyList()

val url = playerUrl.queryParameter("link") ?: playerUrl.toString()
return bloggerExtractor.videosFromUrl(url, headers)
}

// ============================== Filters ===============================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class DooPlayGenerator : ThemeSourceGenerator {
SingleLang("AnimeOnline360", "https://animeonline360.me", "en", isNsfw = false),
SingleLang("AnimeOnline.Ninja", "https://ww3.animeonline.ninja", "es", className = "AnimeOnlineNinja", isNsfw = false, overrideVersionCode = 34),
SingleLang("AnimesOnline", "https://animesonline.nz", "pt-BR", isNsfw = false, overrideVersionCode = 6, pkgName = "animesgratis"),
SingleLang("AnimePlayer", "https://animeplayer.com.br", "pt-BR", isNsfw = true, overrideVersionCode = 1),
SingleLang("AnimePlayer", "https://animeplayer.com.br", "pt-BR", isNsfw = true, overrideVersionCode = 2),
SingleLang("AnimeSAGA", "https://www.animesaga.in", "hi", isNsfw = false, overrideVersionCode = 6),
SingleLang("AnimesFox BR", "https://animesfox.net", "pt-BR", isNsfw = false, overrideVersionCode = 2),
SingleLang("Animes House", "https://animeshouse.net", "pt-BR", isNsfw = false, overrideVersionCode = 7),
Expand Down

0 comments on commit 81909af

Please sign in to comment.