Add two sources to MangaThemesia (#19485)

* Add NekoScans

* Add NSFW flag

* Add TresDaosScan
This commit is contained in:
bapeey 2023-12-30 16:54:08 -05:00 committed by GitHub
parent badca890bb
commit 5835112840
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 80 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 KiB

View File

@ -0,0 +1,58 @@
package eu.kanade.tachiyomi.extension.es.nekoscans
import android.util.Base64
import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import eu.kanade.tachiyomi.source.model.Page
import kotlinx.serialization.json.jsonArray
import kotlinx.serialization.json.jsonPrimitive
import org.jsoup.nodes.Document
import java.lang.IllegalArgumentException
import java.text.SimpleDateFormat
import java.util.Locale
import java.util.concurrent.TimeUnit
class NekoScans : MangaThemesia(
"NekoScans",
"https://nekoscans.com",
"es",
mangaUrlDirectory = "/proyecto",
dateFormat = SimpleDateFormat("MMMM dd, yyyy", Locale("es")),
) {
override val client = super.client.newBuilder()
.rateLimit(2, 1, TimeUnit.SECONDS)
.build()
override val seriesStatusSelector = ".tsinfo .imptdt:contains(estado) i"
override fun pageListParse(document: Document): List<Page> {
val chapterUrl = document.location()
val htmlPages = document.select(pageSelector)
.filterNot { it.imgAttr().isEmpty() }
.mapIndexed { i, img -> Page(i, chapterUrl, img.imgAttr()) }
countViews(document)
// Some sites also loads pages via javascript
if (htmlPages.isNotEmpty()) { return htmlPages }
var docString = document.toString()
document.select("div#content > div.wrapper > script[src^=data:text/javascript;base64,]").forEach { script ->
val scriptText = String(Base64.decode(script.attr("src").substringAfter("base64,"), Base64.DEFAULT))
docString += scriptText
}
val imageListJson = JSON_IMAGE_LIST_REGEX.find(docString)?.destructured?.toList()?.get(0).orEmpty()
val imageList = try {
json.parseToJsonElement(imageListJson).jsonArray
} catch (_: IllegalArgumentException) {
emptyList()
}
val scriptPages = imageList.mapIndexed { i, jsonEl ->
Page(i, chapterUrl, jsonEl.jsonPrimitive.content)
}
return scriptPages
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

View File

@ -0,0 +1,20 @@
package eu.kanade.tachiyomi.extension.es.tresdaosscan
import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import java.text.SimpleDateFormat
import java.util.Locale
import java.util.concurrent.TimeUnit
class TresDaosScan : MangaThemesia(
"Tres Daos Scan",
"https://tresdaos.com",
"es",
dateFormat = SimpleDateFormat("MMMM dd, yyyy", Locale("es")),
) {
override val client = super.client.newBuilder()
.rateLimit(2, 1, TimeUnit.SECONDS)
.build()
override val seriesStatusSelector = ".tsinfo .imptdt:contains(estado) i"
}

View File

@ -109,6 +109,7 @@ class MangaThemesiaGenerator : ThemeSourceGenerator {
SingleLang("MirrorDesu", "https://mirrordesu.me", "id", isNsfw = true), SingleLang("MirrorDesu", "https://mirrordesu.me", "id", isNsfw = true),
SingleLang("Natsu", "https://natsu.id", "id"), SingleLang("Natsu", "https://natsu.id", "id"),
SingleLang("Nekomik", "https://nekomik.me", "id", overrideVersionCode = 2), SingleLang("Nekomik", "https://nekomik.me", "id", overrideVersionCode = 2),
SingleLang("NekoScans", "https://nekoscans.com", "es", isNsfw = true),
SingleLang("Ngomik", "https://ngomik.net", "id", overrideVersionCode = 2), SingleLang("Ngomik", "https://ngomik.net", "id", overrideVersionCode = 2),
SingleLang("NIGHT SCANS", "https://nightscans.net", "en", isNsfw = true, className = "NightScans", overrideVersionCode = 3), SingleLang("NIGHT SCANS", "https://nightscans.net", "en", isNsfw = true, className = "NightScans", overrideVersionCode = 3),
SingleLang("Nocturnal Scans", "https://nocturnalscans.com", "en", overrideVersionCode = 1), SingleLang("Nocturnal Scans", "https://nocturnalscans.com", "en", overrideVersionCode = 1),
@ -153,6 +154,7 @@ class MangaThemesiaGenerator : ThemeSourceGenerator {
SingleLang("TenkaiScan", "https://tenkaiscan.net", "es", isNsfw = true), SingleLang("TenkaiScan", "https://tenkaiscan.net", "es", isNsfw = true),
SingleLang("Tenshi.id", "https://tenshi.id", "id", className = "TenshiId", pkgName = "masterkomik", overrideVersionCode = 4), SingleLang("Tenshi.id", "https://tenshi.id", "id", className = "TenshiId", pkgName = "masterkomik", overrideVersionCode = 4),
SingleLang("The Apollo Team", "https://theapollo.team", "en"), SingleLang("The Apollo Team", "https://theapollo.team", "en"),
SingleLang("Tres Daos Scan", "https://tresdaos.com", "es"),
SingleLang("Tsundoku Traduções", "https://tsundoku.com.br", "pt-BR", className = "TsundokuTraducoes", overrideVersionCode = 9), SingleLang("Tsundoku Traduções", "https://tsundoku.com.br", "pt-BR", className = "TsundokuTraducoes", overrideVersionCode = 9),
SingleLang("TukangKomik", "https://tukangkomik.id", "id", overrideVersionCode = 1), SingleLang("TukangKomik", "https://tukangkomik.id", "id", overrideVersionCode = 1),
SingleLang("TurkToon", "https://turktoon.com", "tr"), SingleLang("TurkToon", "https://turktoon.com", "tr"),