Add SapphireScan (#2519)

Add sapphire
This commit is contained in:
bapeey 2024-04-23 02:59:44 -05:00 committed by Draff
parent b5a49071b7
commit 7fd04cd006
7 changed files with 54 additions and 0 deletions

View File

@ -0,0 +1,9 @@
ext {
extName = 'SapphireScan'
extClass = '.SapphireScan'
themePkg = 'madara'
baseUrl = 'https://sapphirescan.com'
overrideVersionCode = 0
}
apply from: "$rootDir/common.gradle"

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -0,0 +1,45 @@
package eu.kanade.tachiyomi.extension.es.sapphirescan
import eu.kanade.tachiyomi.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimitHost
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import okhttp3.HttpUrl.Companion.toHttpUrl
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.util.Locale
class SapphireScan : Madara(
"SapphireScan",
"https://sapphirescan.com",
"es",
SimpleDateFormat("MMMM dd, yyyy", Locale("es")),
) {
override val client = super.client.newBuilder()
.rateLimitHost(baseUrl.toHttpUrl(), 3)
.build()
override val useNewChapterEndpoint = true
override val useLoadMoreRequest = LoadMoreStrategy.Always
override fun chapterFromElement(element: Element): SChapter {
return super.chapterFromElement(element).apply {
if (element.select("span.required-login").isNotEmpty()) {
name = "🔒 $name"
}
}
}
override fun pageListParse(document: Document): List<Page> {
val pageList = super.pageListParse(document)
if (
pageList.isEmpty() &&
document.select(".content-blocked, .login-required").isNotEmpty()
) {
throw Exception("Inicie sesión en WebView para ver este capítulo")
}
return pageList
}
}