parent
87f31ed04b
commit
c66abf25b9
@ -3,7 +3,7 @@ ext {
|
||||
extClass = '.SirenKomik'
|
||||
themePkg = 'mangathemesia'
|
||||
baseUrl = 'https://sirenkomik.my.id'
|
||||
overrideVersionCode = 6
|
||||
overrideVersionCode = 7
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
@ -1,11 +1,11 @@
|
||||
package eu.kanade.tachiyomi.extension.id.mangkomik
|
||||
|
||||
import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia
|
||||
import eu.kanade.tachiyomi.network.GET
|
||||
import eu.kanade.tachiyomi.network.POST
|
||||
import eu.kanade.tachiyomi.source.model.Page
|
||||
import eu.kanade.tachiyomi.source.model.SChapter
|
||||
import kotlinx.serialization.json.decodeFromStream
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.FormBody
|
||||
import org.jsoup.nodes.Document
|
||||
import org.jsoup.nodes.Element
|
||||
import java.io.IOException
|
||||
@ -42,11 +42,19 @@ class SirenKomik : MangaThemesia(
|
||||
?.let { postIdRegex.find(it)?.groups?.get(1)?.value }
|
||||
?: throw IOException("Post ID not found")
|
||||
|
||||
val pageUrl = "$baseUrl/wp-json/extras/v1/get-img-json".toHttpUrl().newBuilder()
|
||||
.addQueryParameter("post_id", postId)
|
||||
val payload = FormBody.Builder()
|
||||
.add("action", "get_image_json")
|
||||
.add("post_id", postId)
|
||||
.build()
|
||||
|
||||
val dto = client.newCall(GET(pageUrl, headers)).execute().use {
|
||||
val response = client.newCall(POST("$baseUrl/wp-admin/admin-ajax.php", headers, payload))
|
||||
.execute()
|
||||
|
||||
if (response.isSuccessful.not()) {
|
||||
throw IOException("Pages not found")
|
||||
}
|
||||
|
||||
val dto = response.use {
|
||||
json.decodeFromStream<SirenKomikDto>(it.body.byteStream())
|
||||
}
|
||||
|
||||
|
@ -4,15 +4,19 @@ import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class SirenKomikDto(
|
||||
val `data`: Data,
|
||||
val `data`: DataWrapper,
|
||||
) {
|
||||
val pages get() = data.sources.firstOrNull()?.images ?: emptyList()
|
||||
val pages get() = data.data.sources.firstOrNull()?.images ?: emptyList()
|
||||
}
|
||||
|
||||
@Serializable
|
||||
class Source(
|
||||
val images: List<String>,
|
||||
val source: String,
|
||||
)
|
||||
|
||||
@Serializable
|
||||
class DataWrapper(
|
||||
val `data`: Data,
|
||||
)
|
||||
|
||||
@Serializable
|
||||
|
Loading…
x
Reference in New Issue
Block a user