From a0c47228f780a1d256a001bb231575badea925be Mon Sep 17 00:00:00 2001
From: Mike <51273546+SnakeDoc83@users.noreply.github.com>
Date: Thu, 25 Jan 2024 01:00:48 -0500
Subject: [PATCH] Remove mangarok.mobi (#603)
---
src/en/mangarok/AndroidManifest.xml | 2 -
src/en/mangarok/build.gradle | 7 -
.../extension/en/mangarok/MangaRok.kt | 134 ------------------
3 files changed, 143 deletions(-)
delete mode 100644 src/en/mangarok/AndroidManifest.xml
delete mode 100644 src/en/mangarok/build.gradle
delete mode 100644 src/en/mangarok/src/eu/kanade/tachiyomi/extension/en/mangarok/MangaRok.kt
diff --git a/src/en/mangarok/AndroidManifest.xml b/src/en/mangarok/AndroidManifest.xml
deleted file mode 100644
index 8072ee00d..000000000
--- a/src/en/mangarok/AndroidManifest.xml
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
diff --git a/src/en/mangarok/build.gradle b/src/en/mangarok/build.gradle
deleted file mode 100644
index 7d1abb059..000000000
--- a/src/en/mangarok/build.gradle
+++ /dev/null
@@ -1,7 +0,0 @@
-ext {
- extName = 'MangaRok'
- extClass = '.MangaRok'
- extVersionCode = 2
-}
-
-apply from: "$rootDir/common.gradle"
diff --git a/src/en/mangarok/src/eu/kanade/tachiyomi/extension/en/mangarok/MangaRok.kt b/src/en/mangarok/src/eu/kanade/tachiyomi/extension/en/mangarok/MangaRok.kt
deleted file mode 100644
index df09b39a3..000000000
--- a/src/en/mangarok/src/eu/kanade/tachiyomi/extension/en/mangarok/MangaRok.kt
+++ /dev/null
@@ -1,134 +0,0 @@
-package eu.kanade.tachiyomi.extension.en.mangarok
-
-import eu.kanade.tachiyomi.network.GET
-import eu.kanade.tachiyomi.source.model.FilterList
-import eu.kanade.tachiyomi.source.model.Page
-import eu.kanade.tachiyomi.source.model.SChapter
-import eu.kanade.tachiyomi.source.model.SManga
-import eu.kanade.tachiyomi.source.online.ParsedHttpSource
-import okhttp3.HttpUrl.Companion.toHttpUrl
-import okhttp3.Request
-import org.jsoup.nodes.Document
-import org.jsoup.nodes.Element
-import java.text.SimpleDateFormat
-import java.util.Locale
-
-class MangaRok : ParsedHttpSource() {
- override val name = "MangaRok"
-
- override val baseUrl = "https://mangarok.mobi"
-
- override val lang = "en"
-
- override val supportsLatest = true
-
- private val dateFormat = SimpleDateFormat("yyy/MM/dd", Locale.US)
-
- private val floatPattern = Regex("""\d+(?:\.\d+)?""")
-
- // Popular
- override fun popularMangaRequest(page: Int): Request =
- GET("$baseUrl/category/all", headers)
-
- override fun popularMangaSelector(): String =
- searchMangaSelector()
-
- override fun popularMangaFromElement(element: Element): SManga =
- searchMangaFromElement(element)
-
- override fun popularMangaNextPageSelector(): String? =
- searchMangaNextPageSelector()
-
- // Search
- override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
- val url = "$baseUrl/search".toHttpUrl().newBuilder()
- .addQueryParameter("q", query)
- .addQueryParameter("page", page.toString())
-
- return GET(url.build(), headers)
- }
- override fun searchMangaSelector(): String =
- ".is-half > a.box"
-
- override fun searchMangaFromElement(element: Element): SManga = SManga.create().apply {
- setUrlWithoutDomain(element.attr("abs:href"))
- title = element.selectFirst(".mtitle")!!.ownText()
- thumbnail_url = element.selectFirst("img")!!.attr("abs:data-src")
-
- genre = element.select(".tag.is-small").joinToString { it.text() }
- status = element.selectFirst(".msub")!!.text().substringBefore(" ").toStatus()
- }
-
- override fun searchMangaNextPageSelector(): String =
- ".buttons > a[rel=next]:not([disabled])"
-
- // Latest
- override fun latestUpdatesRequest(page: Int): Request =
- GET("$baseUrl/category/latest", headers)
-
- override fun latestUpdatesSelector(): String =
- searchMangaSelector()
-
- override fun latestUpdatesFromElement(element: Element): SManga =
- searchMangaFromElement(element)
-
- override fun latestUpdatesNextPageSelector(): String =
- searchMangaNextPageSelector()
-
- // Details
- override fun mangaDetailsParse(document: Document): SManga = SManga.create().apply {
- title = document.selectFirst("h1.title")!!.text()
- thumbnail_url = document.selectFirst("img.athumbnail")!!.attr("abs:data-src")
-
- val table = document.selectFirst(".table:not(.is-hoverable)")!!
- artist = table.selectFirst("tr > td:first-child:contains(Artist:) + td > a")?.text()
- author = table.selectFirst("tr > td:first-child:contains(Author:) + td > a")?.text()
-
- val altNames = table.select("tr > td:first-child:contains(Alt names:) + td > span")
- .map { it.text().trimEnd(',') }
-
- description = (document.select("div.content")[1].selectFirst("p")?.text() ?: "") +
- (altNames.takeIf { it.isNotEmpty() }?.let { "\n\nAlt name(s): ${it.joinToString()}" } ?: "")
-
- // Includes "Genre", "Demographic", and "Content"
- genre = table.select("tr > td:first-child:contains(Genre:) + td > span")
- .joinToString { it.text() }
- }
-
- // Chapters
- override fun chapterListSelector(): String =
- "table.is-hoverable > tbody > tr"
-
- override fun chapterFromElement(element: Element): SChapter = SChapter.create().apply {
- val a = element.selectFirst("a")!!
- setUrlWithoutDomain(a.attr("abs:href"))
- name = a.text()
-
- val dateString = element.selectFirst("td:nth-child(2)")!!.text()
- date_upload = dateFormat
- .parse(dateString)
- ?.time ?: 0L
-
- chapter_number = floatPattern.find(name)?.value?.toFloatOrNull() ?: -1f
- }
-
- // Pages
- override fun pageListParse(document: Document): List {
- return document.select("p > img.lzl").mapIndexed { i, img ->
- Page(i, "", img.attr("abs:data-src"))
- }
- }
-
- override fun imageUrlParse(document: Document): String =
- throw UnsupportedOperationException()
-
- // Filters
- override fun getFilterList(): FilterList = FilterList()
-
- // Other
- private fun String.toStatus(): Int = when (this) {
- "Completed" -> SManga.COMPLETED
- "Ongoing" -> SManga.ONGOING
- else -> SManga.UNKNOWN
- }
-}