MangaSwat: update domain (#17213)
Also fixes chapter name and date parsing
This commit is contained in:
parent
56ef9952b1
commit
459fb936bb
|
@ -8,11 +8,13 @@ import eu.kanade.tachiyomi.extension.BuildConfig
|
|||
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.SChapter
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.decodeFromString
|
||||
import okhttp3.Headers
|
||||
import okhttp3.OkHttpClient
|
||||
import org.jsoup.nodes.Document
|
||||
import org.jsoup.nodes.Element
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
import java.text.SimpleDateFormat
|
||||
|
@ -22,9 +24,9 @@ class MangaSwat : MangaThemesia(
|
|||
"MangaSwat",
|
||||
"https://swatmanga.me",
|
||||
"ar",
|
||||
dateFormat = SimpleDateFormat("yyyy-MM-dd", Locale.US),
|
||||
dateFormat = SimpleDateFormat("MMMM dd, yyyy", Locale("ar")),
|
||||
) {
|
||||
private val defaultBaseUrl = "https://swatmanga.me"
|
||||
private val defaultBaseUrl = "https://swatop.club"
|
||||
|
||||
override val baseUrl by lazy { getPrefBaseUrl() }
|
||||
|
||||
|
@ -55,6 +57,13 @@ class MangaSwat : MangaThemesia(
|
|||
|
||||
override fun chapterListSelector() = "div.bxcl li, ul div:has(span.lchx)"
|
||||
|
||||
override fun chapterFromElement(element: Element) = SChapter.create().apply {
|
||||
val urlElements = element.select("a")
|
||||
setUrlWithoutDomain(urlElements.attr("href"))
|
||||
name = element.select(".lch a, .chapternum").text().ifBlank { urlElements.last()!!.text() }
|
||||
date_upload = element.selectFirst(".chapter-date")?.text().parseChapterDate()
|
||||
}
|
||||
|
||||
@Serializable
|
||||
data class TSReader(
|
||||
val sources: List<ReaderImageSource>,
|
||||
|
|
|
@ -72,7 +72,7 @@ class MangaThemesiaGenerator : ThemeSourceGenerator {
|
|||
SingleLang("MangaWT", "https://mangawt.com", "tr", overrideVersionCode = 5),
|
||||
SingleLang("Mangayaro", "https://mangayaro.net", "id"),
|
||||
SingleLang("Manhwa Lover", "https://manhwalover.com", "en", isNsfw = true, overrideVersionCode = 1),
|
||||
SingleLang("MangaSwat", "https://swatmanga.me", "ar", overrideVersionCode = 9),
|
||||
SingleLang("MangaSwat", "https://swatop.club", "ar", overrideVersionCode = 10),
|
||||
SingleLang("MangKomik", "https://mangkomik.net", "id", overrideVersionCode = 1),
|
||||
SingleLang("Mangás Chan", "https://mangaschan.com", "pt-BR", className = "MangasChan"),
|
||||
SingleLang("Manhwa Freak", "https://manhwafreak.com", "en", overrideVersionCode = 1),
|
||||
|
|
Loading…
Reference in New Issue