diff --git a/src/tr/mangaokutr/build.gradle b/src/tr/mangaokutr/build.gradle new file mode 100644 index 000000000..5da97333d --- /dev/null +++ b/src/tr/mangaokutr/build.gradle @@ -0,0 +1,10 @@ +ext { + extName = 'Manga Oku TR' + extClass = '.MangaOkuTr' + themePkg = 'mangathemesia' + baseUrl = 'https://mangaokutr.com' + overrideVersionCode = 0 + isNsfw = false +} + +apply from: "$rootDir/common.gradle" diff --git a/src/tr/mangaokutr/res/mipmap-hdpi/ic_launcher.png b/src/tr/mangaokutr/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 000000000..39a1e22a0 Binary files /dev/null and b/src/tr/mangaokutr/res/mipmap-hdpi/ic_launcher.png differ diff --git a/src/tr/mangaokutr/res/mipmap-mdpi/ic_launcher.png b/src/tr/mangaokutr/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 000000000..e6b3ad47a Binary files /dev/null and b/src/tr/mangaokutr/res/mipmap-mdpi/ic_launcher.png differ diff --git a/src/tr/mangaokutr/res/mipmap-xhdpi/ic_launcher.png b/src/tr/mangaokutr/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000..aca0f432d Binary files /dev/null and b/src/tr/mangaokutr/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/src/tr/mangaokutr/res/mipmap-xxhdpi/ic_launcher.png b/src/tr/mangaokutr/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 000000000..87624e1dd Binary files /dev/null and b/src/tr/mangaokutr/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/src/tr/mangaokutr/res/mipmap-xxxhdpi/ic_launcher.png b/src/tr/mangaokutr/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000..d5a003085 Binary files /dev/null and b/src/tr/mangaokutr/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/src/tr/mangaokutr/src/eu/kanade/tachiyomi/extension/tr/mangaokutr/MangaOkuTr.kt b/src/tr/mangaokutr/src/eu/kanade/tachiyomi/extension/tr/mangaokutr/MangaOkuTr.kt new file mode 100644 index 000000000..79714c4e8 --- /dev/null +++ b/src/tr/mangaokutr/src/eu/kanade/tachiyomi/extension/tr/mangaokutr/MangaOkuTr.kt @@ -0,0 +1,35 @@ +package eu.kanade.tachiyomi.extension.tr.mangaokutr + +import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia +import okhttp3.HttpUrl.Companion.toHttpUrl +import okhttp3.Interceptor +import okhttp3.Response +import java.text.SimpleDateFormat +import java.util.Locale + +class MangaOkuTr : MangaThemesia( + "Manga Oku TR", + "https://mangaokutr.com", + "tr", + dateFormat = SimpleDateFormat("MMMM d, yyyy", Locale("tr")), +) { + override val client = network.cloudflareClient.newBuilder() + .addInterceptor(::statusCodeInterceptor) + .build() + + private fun statusCodeInterceptor(chain: Interceptor.Chain): Response { + val request = chain.request() + val response = chain.proceed(request) + if (response.code != 500) return response + if (response.header("cf-mitigated") != null) return response + if (request.url.host != baseUrl.toHttpUrl().host) return response + + // Browse is normally error 500 (???) + return response.newBuilder() + .code(200) + .build() + } + + override val seriesTypeSelector = ".tsinfo .imptdt:contains(Tür) a" + override val seriesDescriptionSelector = "h2 + .entry-content > p:not(:contains(Kategoriler: ))" +}