Fix MangaRead parse #87

This commit is contained in:
Koitharu
2022-01-23 07:49:03 +02:00
parent 197393fbd1
commit 852f31574f
2 changed files with 6 additions and 4 deletions

View File

@@ -13,8 +13,8 @@ android {
applicationId 'org.koitharu.kotatsu'
minSdkVersion 21
targetSdkVersion 31
versionCode 378
versionName '2.1.2'
versionCode 379
versionName '2.1.3'
generatedDensities = []
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

View File

@@ -151,8 +151,10 @@ class MangareadRepository(
?.selectFirst("div.reading-content")
?: throw ParseException("Root not found")
return root.select("div.page-break").map { div ->
val img = div.selectFirst("img")
val url = img?.relUrl("src") ?: parseFailed("Page image not found")
val img = div.selectFirst("img") ?: parseFailed("Page image not found")
val url = img.relUrl("data-src").ifEmpty {
img.relUrl("src")
}
MangaPage(
id = generateUid(url),
url = url,