fix(pt/animesgames): Fixed pt/AnimesGames images
This commit is contained in:
parent
dd60c16232
commit
3ddf6ce57e
2 changed files with 17 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
||||||
ext {
|
ext {
|
||||||
extName = 'Animes Games'
|
extName = 'Animes Games'
|
||||||
extClass = '.AnimesGames'
|
extClass = '.AnimesGames'
|
||||||
extVersionCode = 3
|
extVersionCode = 4
|
||||||
}
|
}
|
||||||
|
|
||||||
apply from: "$rootDir/common.gradle"
|
apply from: "$rootDir/common.gradle"
|
||||||
|
|
|
@ -61,7 +61,7 @@ class AnimesGames : ParsedAnimeHttpSource() {
|
||||||
override fun latestUpdatesFromElement(element: Element) = SAnime.create().apply {
|
override fun latestUpdatesFromElement(element: Element) = SAnime.create().apply {
|
||||||
setUrlWithoutDomain(element.attr("href"))
|
setUrlWithoutDomain(element.attr("href"))
|
||||||
title = element.selectFirst("div.tituloEP")!!.text()
|
title = element.selectFirst("div.tituloEP")!!.text()
|
||||||
thumbnail_url = element.selectFirst("img")?.attr("data-lazy-src")
|
thumbnail_url = element.selectFirst("img")?.getImageUrl()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun latestUpdatesNextPageSelector() = "ol.pagination > a:contains(>)"
|
override fun latestUpdatesNextPageSelector() = "ol.pagination > a:contains(>)"
|
||||||
|
@ -144,7 +144,7 @@ class AnimesGames : ParsedAnimeHttpSource() {
|
||||||
override fun searchAnimeFromElement(element: Element) = SAnime.create().apply {
|
override fun searchAnimeFromElement(element: Element) = SAnime.create().apply {
|
||||||
setUrlWithoutDomain(element.attr("href"))
|
setUrlWithoutDomain(element.attr("href"))
|
||||||
title = element.selectFirst("div.tituloAnime")!!.text()
|
title = element.selectFirst("div.tituloAnime")!!.text()
|
||||||
thumbnail_url = element.selectFirst("img")!!.attr("src")
|
thumbnail_url = element.selectFirst("img")!!.getImageUrl()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun searchAnimeNextPageSelector(): String? {
|
override fun searchAnimeNextPageSelector(): String? {
|
||||||
|
@ -159,7 +159,7 @@ class AnimesGames : ParsedAnimeHttpSource() {
|
||||||
title = content.selectFirst("section > h1")!!.text()
|
title = content.selectFirst("section > h1")!!.text()
|
||||||
.removePrefix("Assistir ")
|
.removePrefix("Assistir ")
|
||||||
.removeSuffix("Temporada Online")
|
.removeSuffix("Temporada Online")
|
||||||
thumbnail_url = content.selectFirst("img")?.attr("data-lazy-src")
|
thumbnail_url = content.selectFirst("img")?.getImageUrl()
|
||||||
description = content.select("section.sinopseEp p").eachText().joinToString("\n")
|
description = content.select("section.sinopseEp p").eachText().joinToString("\n")
|
||||||
|
|
||||||
val infos = content.selectFirst("div.info > ol")!!
|
val infos = content.selectFirst("div.info > ol")!!
|
||||||
|
@ -273,6 +273,19 @@ class AnimesGames : ParsedAnimeHttpSource() {
|
||||||
.getOrNull() ?: 0L
|
.getOrNull() ?: 0L
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tries to get the image url via various possible attributes.
|
||||||
|
* Taken from Tachiyomi's Madara multisrc.
|
||||||
|
*/
|
||||||
|
protected open fun Element.getImageUrl(): String? {
|
||||||
|
return when {
|
||||||
|
hasAttr("data-src") -> attr("abs:data-src")
|
||||||
|
hasAttr("data-lazy-src") -> attr("abs:data-lazy-src")
|
||||||
|
hasAttr("srcset") -> attr("abs:srcset").substringBefore(" ")
|
||||||
|
else -> attr("abs:src")
|
||||||
|
}.substringBefore("?resize")
|
||||||
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val PREFIX_SEARCH = "id:"
|
const val PREFIX_SEARCH = "id:"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue