diff --git a/src/pt/readmangas/build.gradle b/src/pt/readmangas/build.gradle index 420e7037a..d58f5488e 100644 --- a/src/pt/readmangas/build.gradle +++ b/src/pt/readmangas/build.gradle @@ -1,7 +1,7 @@ ext { extName = 'Read Mangas' extClass = '.ReadMangas' - extVersionCode = 35 + extVersionCode = 36 } apply from: "$rootDir/common.gradle" diff --git a/src/pt/readmangas/src/eu/kanade/tachiyomi/extension/pt/readmangas/ReadMangas.kt b/src/pt/readmangas/src/eu/kanade/tachiyomi/extension/pt/readmangas/ReadMangas.kt index 145e39755..be0da13ad 100644 --- a/src/pt/readmangas/src/eu/kanade/tachiyomi/extension/pt/readmangas/ReadMangas.kt +++ b/src/pt/readmangas/src/eu/kanade/tachiyomi/extension/pt/readmangas/ReadMangas.kt @@ -20,6 +20,7 @@ import okhttp3.MediaType.Companion.toMediaType import okhttp3.Request import okhttp3.RequestBody.Companion.toRequestBody import okhttp3.Response +import org.json.JSONObject import rx.Observable import uy.kohesive.injekt.injectLazy import java.text.SimpleDateFormat @@ -153,13 +154,16 @@ class ReadMangas() : HttpSource() { val document = response.asJsoup() return SManga.create().apply { title = document.selectFirst("h1")!!.text() + thumbnail_url = document.selectFirst("img.w-full")?.absUrl("src") + genre = document.select("div > label + div > div").joinToString { it.text() } description = document.select("script").map { it.data() } - .firstOrNull { MANGA_DETAILS_DESCRIPTION_REGEX.containsMatchIn(it) } + .firstOrNull { it.contains("description", ignoreCase = true) } ?.let { - MANGA_DETAILS_DESCRIPTION_REGEX.find(it)?.groups?.get("description")?.value + val jsonObject = JSONObject(it) + jsonObject.optString("description", "") } document.selectFirst("div.flex > div.inline-flex.items-center:last-child")?.text()?.let { @@ -290,7 +294,6 @@ class ReadMangas() : HttpSource() { @SuppressLint("SimpleDateFormat") companion object { - val MANGA_DETAILS_DESCRIPTION_REGEX = """description":(?"[^"]+)""".toRegex() val IMAGE_URL_REGEX = """url\\":\\"(?[^(\\")]+)""".toRegex() val dateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")