Migrate CeriseScan (#2596)

* Migrate CeriseScan

* Fix rateLimit

* Remove id
This commit is contained in:
Chopper 2024-04-28 00:07:28 -03:00 committed by GitHub
parent 6ad9991205
commit 0af0b6249d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 42 deletions

View File

@ -1,9 +1,9 @@
ext {
extName = 'Cerise Scan'
extClass = '.CeriseScan'
themePkg = 'madara'
baseUrl = 'https://cerisescan.net'
overrideVersionCode = 8
themePkg = 'peachscan'
baseUrl = 'https://cerisetoon.com'
overrideVersionCode = 40
isNsfw = true
}

View File

@ -1,45 +1,11 @@
package eu.kanade.tachiyomi.extension.pt.cerisescans
import eu.kanade.tachiyomi.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.multisrc.peachscan.PeachScan
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import okhttp3.OkHttpClient
import okhttp3.Request
import java.text.SimpleDateFormat
import java.util.Locale
import java.util.concurrent.TimeUnit
class CeriseScan : Madara(
"Cerise Scan",
"https://cerisescan.net",
"pt-BR",
SimpleDateFormat("dd 'de' MMMMM 'de' yyyy", Locale("pt", "BR")),
) {
// Name changed from 'Cerise Scans' to 'Cerise Scan'
override val id: Long = 8629915907358523454
override val client: OkHttpClient = super.client.newBuilder()
.rateLimit(1, 2, TimeUnit.SECONDS)
class CeriseScan : PeachScan("Cerise Scan", "https://cerisetoon.com", "pt-BR") {
override val versionId: Int = 2
override val client = super.client.newBuilder()
.rateLimit(1, 2)
.build()
override val useNewChapterEndpoint = true
override fun mangaDetailsRequest(manga: SManga): Request {
return GET(baseUrl + manga.url.replace("/home1", ""), headers)
}
override fun chapterListRequest(manga: SManga): Request {
return GET(baseUrl + manga.url.replace("/home1", ""), headers)
}
override fun pageListRequest(chapter: SChapter): Request {
if (chapter.url.startsWith("http")) {
return GET(chapter.url.replace("/home1", ""), headers)
}
return GET(baseUrl + chapter.url.replace("/home1", ""), headers)
}
}