mirror of
https://github.com/keiyoushi/extensions-source.git
synced 2024-11-26 12:12:30 +01:00
Migrate CeriseScan (#2596)
* Migrate CeriseScan * Fix rateLimit * Remove id
This commit is contained in:
parent
6ad9991205
commit
0af0b6249d
@ -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
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user