Add a new source to Madara (closes #11340). (#11351)

This commit is contained in:
Alessandro Jean 2022-04-07 05:53:20 -03:00 committed by GitHub
parent 3484716479
commit cb7d9ad482
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 1 deletions

View File

@ -0,0 +1,22 @@
package eu.kanade.tachiyomi.extension.pt.thesugar
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.multisrc.madara.Madara
import okhttp3.OkHttpClient
import java.text.SimpleDateFormat
import java.util.Locale
import java.util.concurrent.TimeUnit
class TheSugar : Madara(
"The Sugar",
"https://thesugarscan.com",
"pt-BR",
SimpleDateFormat("dd/MM/yyyy", Locale("pt", "BR"))
) {
override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS))
.build()
override val useNewChapterEndpoint = true
}

View File

@ -784,7 +784,7 @@ abstract class Madara(
// Added "title" alternative
chapter.date_upload = select("img:not(.thumb)").firstOrNull()?.attr("alt")?.let { parseRelativeDate(it) }
?: select("span a").firstOrNull()?.attr("title")?.let { parseRelativeDate(it) }
?: parseChapterDate(select("span.chapter-release-date").firstOrNull()?.text())
?: parseChapterDate(select("span.chapter-release-date").firstOrNull()?.text())
}
return chapter

View File

@ -403,6 +403,7 @@ class MadaraGenerator : ThemeSourceGenerator {
SingleLang("TeenManhua", "https://teenmanhua.com", "en"),
SingleLang("The Beginning After The End", "https://www.thebeginningaftertheend.fr", "fr"),
SingleLang("The Guild", "https://theguildscans.com", "en"),
SingleLang("The Sugar", "https://thesugarscan.com", "pt-BR"),
SingleLang("TheFluffyHangoutGroup", "https://www.fluffyhangout.club", "en", overrideVersionCode = 2),
SingleLang("Three Queens Scanlator", "https://tqscan.com.br", "pt-BR", overrideVersionCode = 3),
SingleLang("Tiempo de webeo", "https://tiempodewebeo.com", "es", className = "TiempoDeWebeo", isNsfw = true),