diff --git a/src/pt/hotcabaretscan/build.gradle b/src/pt/hotcabaretscan/build.gradle new file mode 100644 index 000000000..d4459b4ca --- /dev/null +++ b/src/pt/hotcabaretscan/build.gradle @@ -0,0 +1,10 @@ +ext { + extName = 'Hot Cabaret Scan' + extClass = '.HotCabaretScan' + themePkg = 'madara' + baseUrl = 'https://hotcabaretscan.com' + overrideVersionCode = 0 + isNsfw = true +} + +apply from: "$rootDir/common.gradle" diff --git a/src/pt/hotcabaretscan/res/mipmap-hdpi/ic_launcher.png b/src/pt/hotcabaretscan/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 000000000..2558aadf2 Binary files /dev/null and b/src/pt/hotcabaretscan/res/mipmap-hdpi/ic_launcher.png differ diff --git a/src/pt/hotcabaretscan/res/mipmap-mdpi/ic_launcher.png b/src/pt/hotcabaretscan/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 000000000..ff26671d2 Binary files /dev/null and b/src/pt/hotcabaretscan/res/mipmap-mdpi/ic_launcher.png differ diff --git a/src/pt/hotcabaretscan/res/mipmap-xhdpi/ic_launcher.png b/src/pt/hotcabaretscan/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000..49fdebb53 Binary files /dev/null and b/src/pt/hotcabaretscan/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/src/pt/hotcabaretscan/res/mipmap-xxhdpi/ic_launcher.png b/src/pt/hotcabaretscan/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 000000000..62500a529 Binary files /dev/null and b/src/pt/hotcabaretscan/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/src/pt/hotcabaretscan/res/mipmap-xxxhdpi/ic_launcher.png b/src/pt/hotcabaretscan/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000..52ed68acf Binary files /dev/null and b/src/pt/hotcabaretscan/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/src/pt/hotcabaretscan/src/eu/kanade/tachiyomi/extension/pt/hotcabaretscan/HotCabaretScan.kt b/src/pt/hotcabaretscan/src/eu/kanade/tachiyomi/extension/pt/hotcabaretscan/HotCabaretScan.kt new file mode 100644 index 000000000..2746be830 --- /dev/null +++ b/src/pt/hotcabaretscan/src/eu/kanade/tachiyomi/extension/pt/hotcabaretscan/HotCabaretScan.kt @@ -0,0 +1,37 @@ +package eu.kanade.tachiyomi.extension.pt.hotcabaretscan + +import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit +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 HotCabaretScan : Madara( + "Hot Cabaret Scan", + "https://hotcabaretscan.com", + "pt-BR", + SimpleDateFormat("MMMM dd, yyyy", Locale("pt", "BR")), +) { + + override val client: OkHttpClient = super.client.newBuilder() + .rateLimit(1, 2, TimeUnit.SECONDS) + .addInterceptor(::checkPasswordProtectedIntercept) + .build() + + private fun checkPasswordProtectedIntercept(chain: Interceptor.Chain): Response { + val response = chain.proceed(chain.request()) + + if (response.request.url.queryParameter("password-protected") != null) { + response.close() + throw IOException("Autentique-se através da WebView e tente novamente.") + } + + return response + } + + override val useNewChapterEndpoint = true +}