Split Asura Scans to Asura Scans (EN) and Armoni Scans (#439)

* Split Asura Scans to Asura Scans (EN) and Armoni Scans

* Uncomment other sources
This commit is contained in:
beerpsi 2024-01-21 13:42:43 +07:00 committed by GitHub
parent e37f81eba2
commit 72653d045d
10 changed files with 4 additions and 79 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -1,4 +1,4 @@
package eu.kanade.tachiyomi.extension.all.asurascans package eu.kanade.tachiyomi.extension.en.asurascans
import android.app.Application import android.app.Application
import android.content.SharedPreferences import android.content.SharedPreferences
@ -27,7 +27,7 @@ import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
class AsuraScansEn : MangaThemesia( class AsuraScans : MangaThemesia(
"Asura Scans", "Asura Scans",
"https://asuratoon.com", "https://asuratoon.com",
"en", "en",

View File

@ -1,10 +0,0 @@
package eu.kanade.tachiyomi.extension.all.asurascans
import eu.kanade.tachiyomi.source.SourceFactory
class AsuraScansFactory : SourceFactory {
override fun createSources() = listOf(
AsuraScansEn(),
AsuraScansTr(),
)
}

View File

@ -1,66 +0,0 @@
package eu.kanade.tachiyomi.extension.all.asurascans
import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SManga
import kotlinx.serialization.Serializable
import kotlinx.serialization.decodeFromString
import okhttp3.OkHttpClient
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.util.Locale
import java.util.concurrent.TimeUnit
class AsuraScansTr : MangaThemesia(
"Asura Scans",
"https://armoniscans.com",
"tr",
dateFormat = SimpleDateFormat("MMM d, yyyy", Locale("tr")),
) {
override val client: OkHttpClient = super.client.newBuilder()
.rateLimit(1, 3, TimeUnit.SECONDS)
.build()
override val seriesArtistSelector = ".fmed b:contains(Çizer)+span"
override val seriesAuthorSelector = ".fmed b:contains(Yazar)+span"
override val seriesStatusSelector = ".imptdt:contains(Durum) i"
override val seriesTypeSelector = ".imptdt:contains(Tür) a"
override val altNamePrefix: String = "Alternatif isim: "
override fun String?.parseStatus(): Int = when {
this == null -> SManga.UNKNOWN
this.contains("Devam Ediyor", ignoreCase = true) -> SManga.ONGOING
this.contains("Tamamlandı", ignoreCase = true) -> SManga.COMPLETED
else -> SManga.UNKNOWN
}
override fun Element.imgAttr(): String = when {
hasAttr("data-lazy-src") -> attr("abs:data-lazy-src")
hasAttr("data-src") -> attr("abs:data-src")
hasAttr("data-cfsrc") -> attr("abs:data-cfsrc")
else -> attr("abs:src")
}
override fun pageListParse(document: Document): List<Page> {
val scriptContent = document.selectFirst("script:containsData(ts_reader)")?.data()
?: return super.pageListParse(document)
val jsonString = scriptContent.substringAfter("ts_reader.run(").substringBefore(");")
val tsReader = json.decodeFromString<TSReader>(jsonString)
val imageUrls = tsReader.sources.firstOrNull()?.images ?: return emptyList()
return imageUrls.mapIndexed { index, imageUrl -> Page(index, document.location(), imageUrl) }
}
@Serializable
data class TSReader(
val sources: List<ReaderImageSource>,
)
@Serializable
data class ReaderImageSource(
val source: String,
val images: List<String>,
)
}

View File

@ -35,6 +35,7 @@ class MadaraGenerator : ThemeSourceGenerator {
SingleLang("Ansh Scans", "https://anshscans.org", "en", overrideVersionCode = 1), SingleLang("Ansh Scans", "https://anshscans.org", "en", overrideVersionCode = 1),
SingleLang("ApollComics", "https://apollcomics.xyz", "es", isNsfw = true, overrideVersionCode = 2), SingleLang("ApollComics", "https://apollcomics.xyz", "es", isNsfw = true, overrideVersionCode = 2),
SingleLang("Apolltoons", "https://apolltoons.xyz", "es", isNsfw = true), SingleLang("Apolltoons", "https://apolltoons.xyz", "es", isNsfw = true),
SingleLang("Armoni Scans", "https://armoniscans.net", "tr"),
SingleLang("Aqua Manga", "https://aquamanga.org", "en", isNsfw = false, overrideVersionCode = 8), SingleLang("Aqua Manga", "https://aquamanga.org", "en", isNsfw = false, overrideVersionCode = 8),
SingleLang("AQUA Scans", "https://aquascans.com", "en", className = "ManhwaWorld", overrideVersionCode = 1), SingleLang("AQUA Scans", "https://aquascans.com", "en", className = "ManhwaWorld", overrideVersionCode = 1),
SingleLang("ArazNovel", "https://www.araznovel.com", "tr", overrideVersionCode = 3), SingleLang("ArazNovel", "https://www.araznovel.com", "tr", overrideVersionCode = 3),

View File

@ -14,7 +14,6 @@ class MangaThemesiaGenerator : ThemeSourceGenerator {
override val baseVersionCode: Int = 27 override val baseVersionCode: Int = 27
override val sources = listOf( override val sources = listOf(
MultiLang("Asura Scans", "https://asuratoon.com", listOf("en", "tr"), className = "AsuraScansFactory", pkgName = "asurascans", overrideVersionCode = 31),
MultiLang("Miau Scan", "https://miaucomics.org", listOf("es", "pt-BR"), overrideVersionCode = 2), MultiLang("Miau Scan", "https://miaucomics.org", listOf("es", "pt-BR"), overrideVersionCode = 2),
SingleLang("Ainz Scans ID", "https://ainzscans.site", "id"), SingleLang("Ainz Scans ID", "https://ainzscans.site", "id"),
SingleLang("Alceascan", "https://alceascan.my.id", "id"), SingleLang("Alceascan", "https://alceascan.my.id", "id"),
@ -23,6 +22,7 @@ class MangaThemesiaGenerator : ThemeSourceGenerator {
SingleLang("Arkham Scan", "https://arkhamscan.com", "pt-BR"), SingleLang("Arkham Scan", "https://arkhamscan.com", "pt-BR"),
SingleLang("Arven Scans", "https://arvenscans.com", "en"), SingleLang("Arven Scans", "https://arvenscans.com", "en"),
SingleLang("AscalonScans", "https://ascalonscans.com", "en"), SingleLang("AscalonScans", "https://ascalonscans.com", "en"),
SingleLang("Asura Scans", "https://asuratoon.com", "en"),
SingleLang("Azure Scans", "https://azuremanga.com", "en", overrideVersionCode = 1), SingleLang("Azure Scans", "https://azuremanga.com", "en", overrideVersionCode = 1),
SingleLang("Banana-Scan", "https://banana-scan.com", "fr", className = "BananaScan", isNsfw = true), SingleLang("Banana-Scan", "https://banana-scan.com", "fr", className = "BananaScan", isNsfw = true),
SingleLang("Beast Scans", "https://beastscans.net", "ar", overrideVersionCode = 1), SingleLang("Beast Scans", "https://beastscans.net", "ar", overrideVersionCode = 1),