Fix wrong chapter images URL at WPMangaStream. (#8325)
This commit is contained in:
parent
0cfb5cf94a
commit
1543a28487
@ -15,6 +15,7 @@ import kotlinx.serialization.json.Json
|
||||
import kotlinx.serialization.json.jsonArray
|
||||
import kotlinx.serialization.json.jsonPrimitive
|
||||
import okhttp3.Headers
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
|
||||
import okhttp3.OkHttpClient
|
||||
import okhttp3.Request
|
||||
@ -284,10 +285,11 @@ abstract class WPMangaStream(
|
||||
val imageListJson = imageListRegex.find(docString)!!.destructured.toList()[0]
|
||||
|
||||
val imageList = json.parseToJsonElement(imageListJson).jsonArray
|
||||
val baseResolver = baseUrl.toHttpUrl()
|
||||
|
||||
val scriptPages = imageList.mapIndexed { i, jsonEl ->
|
||||
val imageUrl = jsonEl.jsonPrimitive.content
|
||||
Page(i, "", if (imageUrl.startsWith(baseUrl)) imageUrl else baseUrl + imageUrl)
|
||||
Page(i, "", baseResolver.resolve(imageUrl).toString())
|
||||
}
|
||||
|
||||
if (htmlPages.size < scriptPages.size) {
|
||||
|
@ -9,7 +9,7 @@ class WPMangaStreamGenerator : ThemeSourceGenerator {
|
||||
|
||||
override val themeClass = "WPMangaStream"
|
||||
|
||||
override val baseVersionCode: Int = 8
|
||||
override val baseVersionCode: Int = 9
|
||||
|
||||
override val sources = listOf(
|
||||
SingleLang("Asura Scans", "https://www.asurascans.com", "en", overrideVersionCode = 5),
|
||||
|
Loading…
x
Reference in New Issue
Block a user