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