Fix StarboundScans revert to old loading by using src attribute (#10575)

* fix(starboundscans): revert to old src because of site

* Fix Review
This commit is contained in:
Aurel 2025-09-20 10:43:29 +02:00 committed by Draff
parent 84da2bf59f
commit f1f374f773
Signed by: Draff
GPG Key ID: E8A89F3211677653
2 changed files with 10 additions and 2 deletions

View File

@ -3,7 +3,7 @@ ext {
extClass = '.StarboundScans'
themePkg = 'madara'
baseUrl = 'https://starboundscans.com'
overrideVersionCode = 1
overrideVersionCode = 2
isNsfw = false
}

View File

@ -8,6 +8,7 @@ import keiyoushi.utils.tryParse
import okhttp3.Headers
import okhttp3.Response
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.util.Locale
@ -63,9 +64,16 @@ class StarboundScans : Madara(
}
}
private fun Element.imgAttr(): String {
return when {
hasAttr("data-src") -> attr("abs:data-src")
else -> attr("abs:src")
}
}
override fun pageListParse(document: Document): List<Page> {
return document.select("img.wp-manga-chapter-img").mapIndexed { index, element ->
val imageUrl = element.attr("abs:data-src")
val imageUrl = element.imgAttr()
Page(index, url = document.location(), imageUrl = imageUrl)
}
}