Comic Extra - Update to new URL and page selector (#2132)

* Update ComicExtra.kt

Changed base URL to new one

* Updated extVersionCode in build.gradle

* Updated page list selector to the new one

* ComicExtra - fix search

* Changed to addQueryParameter and added pagination

* Imports

* lint
This commit is contained in:
Barrell Titor 2024-03-28 12:03:58 +02:00 committed by Draff
parent 471e4d3190
commit 01de950ce9
2 changed files with 9 additions and 4 deletions

View File

@ -1,7 +1,7 @@
ext { ext {
extName = 'ComicExtra' extName = 'ComicExtra'
extClass = '.ComicExtra' extClass = '.ComicExtra'
extVersionCode = 14 extVersionCode = 15
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -8,6 +8,7 @@ import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.source.online.ParsedHttpSource import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.HttpUrl.Companion.toHttpUrl
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import okhttp3.Request import okhttp3.Request
import okhttp3.Response import okhttp3.Response
@ -22,7 +23,7 @@ class ComicExtra : ParsedHttpSource() {
override val name = "ComicExtra" override val name = "ComicExtra"
override val baseUrl = "https://comicextra.me" override val baseUrl = "https://comicextra.org"
override val lang = "en" override val lang = "en"
@ -40,7 +41,11 @@ class ComicExtra : ParsedHttpSource() {
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
return if (query.isNotBlank()) { return if (query.isNotBlank()) {
GET("$baseUrl/comic-search?key=$query", headers) val url = "$baseUrl/search".toHttpUrl().newBuilder().apply {
addQueryParameter("keyword", query)
if (page > 1) addQueryParameter("page", page.toString())
}.build()
GET(url, headers)
} else { } else {
var url = baseUrl var url = baseUrl
filters.forEach { filter -> filters.forEach { filter ->
@ -153,7 +158,7 @@ class ComicExtra : ParsedHttpSource() {
override fun pageListParse(document: Document): List<Page> { override fun pageListParse(document: Document): List<Page> {
val pages = mutableListOf<Page>() val pages = mutableListOf<Page>()
document.select("img.chapter_img").forEachIndexed { i, img -> document.select("div.chapter-container img").forEachIndexed { i, img ->
pages.add(Page(i, "", img.attr("abs:src"))) pages.add(Page(i, "", img.attr("abs:src")))
} }
return pages return pages