diff --git a/multisrc/overrides/madara/fleurblanche/res/mipmap-hdpi/ic_launcher.png b/multisrc/overrides/madara/fleurblanche/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 000000000..ff667fb8d Binary files /dev/null and b/multisrc/overrides/madara/fleurblanche/res/mipmap-hdpi/ic_launcher.png differ diff --git a/multisrc/overrides/madara/fleurblanche/res/mipmap-mdpi/ic_launcher.png b/multisrc/overrides/madara/fleurblanche/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 000000000..ac4bd9a80 Binary files /dev/null and b/multisrc/overrides/madara/fleurblanche/res/mipmap-mdpi/ic_launcher.png differ diff --git a/multisrc/overrides/madara/fleurblanche/res/mipmap-xhdpi/ic_launcher.png b/multisrc/overrides/madara/fleurblanche/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000..609665b72 Binary files /dev/null and b/multisrc/overrides/madara/fleurblanche/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/multisrc/overrides/madara/fleurblanche/res/mipmap-xxhdpi/ic_launcher.png b/multisrc/overrides/madara/fleurblanche/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 000000000..4c3f27045 Binary files /dev/null and b/multisrc/overrides/madara/fleurblanche/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/multisrc/overrides/madara/fleurblanche/res/mipmap-xxxhdpi/ic_launcher.png b/multisrc/overrides/madara/fleurblanche/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000..5b0886e02 Binary files /dev/null and b/multisrc/overrides/madara/fleurblanche/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/multisrc/overrides/madara/fleurblanche/res/web_hi_res_512.png b/multisrc/overrides/madara/fleurblanche/res/web_hi_res_512.png new file mode 100644 index 000000000..968834342 Binary files /dev/null and b/multisrc/overrides/madara/fleurblanche/res/web_hi_res_512.png differ diff --git a/multisrc/overrides/madara/fleurblanche/src/FleurBlanche.kt b/multisrc/overrides/madara/fleurblanche/src/FleurBlanche.kt new file mode 100644 index 000000000..f4df29684 --- /dev/null +++ b/multisrc/overrides/madara/fleurblanche/src/FleurBlanche.kt @@ -0,0 +1,45 @@ +package eu.kanade.tachiyomi.extension.pt.fleurblanche + +import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor +import eu.kanade.tachiyomi.multisrc.madara.Madara +import okhttp3.Headers +import okhttp3.Interceptor +import okhttp3.OkHttpClient +import okhttp3.Response +import java.io.IOException +import java.text.SimpleDateFormat +import java.util.Locale +import java.util.concurrent.TimeUnit + +class FleurBlanche : Madara( + "Fleur Blanche", + "https://fbsquadz.com", + "pt-BR", + SimpleDateFormat("MMMMM dd, yyyy", Locale("pt", "BR")) +) { + + override val client: OkHttpClient = super.client.newBuilder() + .addInterceptor(::authWarningIntercept) + .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .build() + + override val useNewChapterEndpoint = true + + override fun headersBuilder(): Headers.Builder = Headers.Builder() + + private fun authWarningIntercept(chain: Interceptor.Chain): Response { + val response = chain.proceed(chain.request()) + + if (response.request.url.toString().contains("wp-login.php")) { + response.close() + throw IOException(NEED_LOGIN_ERROR) + } + + return response + } + + companion object { + private const val NEED_LOGIN_ERROR = + "É necessário realizar o login via WebView para acessar a fonte." + } +} diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madara/MadaraGenerator.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madara/MadaraGenerator.kt index b141168bb..fafe760c7 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madara/MadaraGenerator.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madara/MadaraGenerator.kt @@ -99,6 +99,7 @@ class MadaraGenerator : ThemeSourceGenerator { SingleLang("FastManhwa", "https://fastmanhwa.net", "en", isNsfw = true, overrideVersionCode = 2), SingleLang("Final Scans", "https://finalscans.com", "pt-BR", isNsfw = true, overrideVersionCode = 1), SingleLang("Fiz Manga", "https://fizmanga.com", "en"), + SingleLang("Fleur Blanche", "https://fbsquadz.com", "pt-BR", isNsfw = true, overrideVersionCode = 1), SingleLang("Fox White", "https://foxwhite.com.br", "pt-BR"), SingleLang("Free Manga", "https://freemanga.me", "en", isNsfw = true, overrideVersionCode = 3), SingleLang("FreeWebtoonCoins", "https://freewebtooncoins.com", "en", overrideVersionCode = 1),