From 77ac036786f240ef8adb99e955573cf3136839b6 Mon Sep 17 00:00:00 2001 From: AwkwardPeak7 <48650614+AwkwardPeak7@users.noreply.github.com> Date: Sat, 10 Aug 2024 17:52:57 +0500 Subject: [PATCH] StrayFansub: update theme (#4545) --- src/tr/strayfansub/build.gradle | 4 ++-- .../extension/tr/strayfansub/StrayFansub.kt | 21 +++++++++++++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/tr/strayfansub/build.gradle b/src/tr/strayfansub/build.gradle index 647f4c0b8..63659d30f 100644 --- a/src/tr/strayfansub/build.gradle +++ b/src/tr/strayfansub/build.gradle @@ -1,9 +1,9 @@ ext { extName = 'Stray Fansub' extClass = '.StrayFansub' - themePkg = 'mangathemesia' + themePkg = 'madara' baseUrl = 'https://strayfansub.com' - overrideVersionCode = 7 + overrideVersionCode = 2 isNsfw = true } diff --git a/src/tr/strayfansub/src/eu/kanade/tachiyomi/extension/tr/strayfansub/StrayFansub.kt b/src/tr/strayfansub/src/eu/kanade/tachiyomi/extension/tr/strayfansub/StrayFansub.kt index 0f5073558..dd0060f8c 100644 --- a/src/tr/strayfansub/src/eu/kanade/tachiyomi/extension/tr/strayfansub/StrayFansub.kt +++ b/src/tr/strayfansub/src/eu/kanade/tachiyomi/extension/tr/strayfansub/StrayFansub.kt @@ -1,17 +1,34 @@ package eu.kanade.tachiyomi.extension.tr.strayfansub -import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia +import eu.kanade.tachiyomi.multisrc.madara.Madara import eu.kanade.tachiyomi.network.interceptor.rateLimitHost +import eu.kanade.tachiyomi.source.model.Page import okhttp3.HttpUrl.Companion.toHttpUrl +import org.jsoup.nodes.Document import java.text.SimpleDateFormat import java.util.Locale -class StrayFansub : MangaThemesia( +class StrayFansub : Madara( "Stray Fansub", "https://strayfansub.com", "tr", dateFormat = SimpleDateFormat("MMMM d, yyyy", Locale("tr")), ) { + override val useLoadMoreRequest = LoadMoreStrategy.Never + override val useNewChapterEndpoint = true + + override fun pageListParse(document: Document): List { + val pageList = super.pageListParse(document) + + if ( + pageList.isEmpty() && + document.select(".content-blocked, .login-required").isNotEmpty() + ) { + throw Exception("Okumak için WebView üzerinden giriş yapın") + } + return pageList + } + override val client = super.client.newBuilder() .rateLimitHost(baseUrl.toHttpUrl(), 3) .build()