diff --git a/src/tr/epikman/build.gradle b/src/tr/epikman/build.gradle new file mode 100644 index 000000000..f8571e4e7 --- /dev/null +++ b/src/tr/epikman/build.gradle @@ -0,0 +1,9 @@ +ext { + extName = 'Epikman' + extClass = '.Epikman' + themePkg = 'zeistmanga' + baseUrl = 'https://www.epikman.ga' + overrideVersionCode = 0 +} + +apply from: "$rootDir/common.gradle" diff --git a/src/tr/epikman/res/mipmap-hdpi/ic_launcher.png b/src/tr/epikman/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 000000000..2b01b7f35 Binary files /dev/null and b/src/tr/epikman/res/mipmap-hdpi/ic_launcher.png differ diff --git a/src/tr/epikman/res/mipmap-mdpi/ic_launcher.png b/src/tr/epikman/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 000000000..8fbf8dff7 Binary files /dev/null and b/src/tr/epikman/res/mipmap-mdpi/ic_launcher.png differ diff --git a/src/tr/epikman/res/mipmap-xhdpi/ic_launcher.png b/src/tr/epikman/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000..32101876e Binary files /dev/null and b/src/tr/epikman/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/src/tr/epikman/res/mipmap-xxhdpi/ic_launcher.png b/src/tr/epikman/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 000000000..c9b45eced Binary files /dev/null and b/src/tr/epikman/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/src/tr/epikman/res/mipmap-xxxhdpi/ic_launcher.png b/src/tr/epikman/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000..5bb788a3c Binary files /dev/null and b/src/tr/epikman/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/src/tr/epikman/src/eu/kanade/tachiyomi/extension/tr/epikman/Epikman.kt b/src/tr/epikman/src/eu/kanade/tachiyomi/extension/tr/epikman/Epikman.kt new file mode 100644 index 000000000..f7ea067c9 --- /dev/null +++ b/src/tr/epikman/src/eu/kanade/tachiyomi/extension/tr/epikman/Epikman.kt @@ -0,0 +1,69 @@ +package eu.kanade.tachiyomi.extension.tr.epikman + +import eu.kanade.tachiyomi.multisrc.zeistmanga.ZeistManga +import eu.kanade.tachiyomi.network.GET +import eu.kanade.tachiyomi.source.model.FilterList +import eu.kanade.tachiyomi.source.model.MangasPage +import eu.kanade.tachiyomi.source.model.SManga +import eu.kanade.tachiyomi.util.asJsoup +import okhttp3.HttpUrl.Companion.toHttpUrl +import okhttp3.Request +import okhttp3.Response +import org.jsoup.nodes.Document + +class Epikman : ZeistManga( + "Epikman", + "https://www.epikman.ga", + "tr", +) { + override val useOldChapterFeed = true + override val chapterCategory = "Bölüm" + override val pageListSelector = ".chapter-view" + + private var nextLatestPageUrl: String = "" + + override fun latestUpdatesRequest(page: Int): Request { + if (page == 1) { + nextLatestPageUrl = "" + } + + val url = nextLatestPageUrl.ifBlank { + "$baseUrl/search/label/Seri?max-results=20" + } + return GET(url, headers) + } + + override fun latestUpdatesParse(response: Response): MangasPage { + val document = response.asJsoup() + val mangas = mangaListParse(document) + val nextPage = document.selectFirst("a[title='Önceki Kayıtlar']") + + nextPage?.let { + nextLatestPageUrl = it.absUrl("href") + } + + return MangasPage(mangas, nextPage != null) + } + + override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { + val url = "$baseUrl/search".toHttpUrl().newBuilder() + .addQueryParameter("q", query) + .addQueryParameter("max-results", "999") + .build() + return GET(url, headers) + } + + override fun searchMangaParse(response: Response) = + MangasPage(mangaListParse(response.asJsoup()), false) + + private fun mangaListParse(document: Document) = + document.select("#Blog1 .grid > div").map { element -> + SManga.create().apply { + with(element.selectFirst(".clamp")!!) { + title = text() + setUrlWithoutDomain(absUrl("href")) + } + thumbnail_url = element.selectFirst("img")!!.absUrl("src") + } + } +}