Hanime1: Filter ads from search results and more #846

Merged
AlphaBoom merged 4 commits from hanime into main 2025-03-24 13:29:26 -05:00
2 changed files with 2 additions and 2 deletions
Showing only changes of commit d54d4368e7 - Show all commits

View file

@ -1,7 +1,7 @@
ext { ext {
extName = 'Hanime1' extName = 'Hanime1'
extClass = '.Hanime1' extClass = '.Hanime1'
extVersionCode = 3 extVersionCode = 4
isNsfw = true isNsfw = true
} }

View file

@ -111,7 +111,7 @@ class Hanime1 : AnimeHttpSource(), ConfigurableAnimeSource {
}.filterNot { it.videoUrl?.startsWith("blob") == true } }.filterNot { it.videoUrl?.startsWith("blob") == true }
.sortedByDescending { preferQuality == it.quality } .sortedByDescending { preferQuality == it.quality }
.ifEmpty { .ifEmpty {
// found source from script content // Try to find the source from the script content.
val videoUrl = doc.select("script[type=application/ld+json]").first()!!.data().let { val videoUrl = doc.select("script[type=application/ld+json]").first()!!.data().let {
val info = json.decodeFromString<JsonElement>(it).jsonObject val info = json.decodeFromString<JsonElement>(it).jsonObject
info["contentUrl"]!!.jsonPrimitive.content info["contentUrl"]!!.jsonPrimitive.content