From c84ee6d588473640bfa6c7c9843b00053f1254da Mon Sep 17 00:00:00 2001
From: Mike <51273546+SnakeDoc83@users.noreply.github.com>
Date: Thu, 25 Jan 2024 01:03:21 -0500
Subject: [PATCH] Remove rawdevart.com (#607)
---
src/ja/rawdevart/AndroidManifest.xml | 2 -
src/ja/rawdevart/build.gradle | 7 -
.../extension/ja/rawdevart/Rawdevart.kt | 355 ------------------
3 files changed, 364 deletions(-)
delete mode 100644 src/ja/rawdevart/AndroidManifest.xml
delete mode 100644 src/ja/rawdevart/build.gradle
delete mode 100644 src/ja/rawdevart/src/eu/kanade/tachiyomi/extension/ja/rawdevart/Rawdevart.kt
diff --git a/src/ja/rawdevart/AndroidManifest.xml b/src/ja/rawdevart/AndroidManifest.xml
deleted file mode 100644
index 8072ee00d..000000000
--- a/src/ja/rawdevart/AndroidManifest.xml
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
diff --git a/src/ja/rawdevart/build.gradle b/src/ja/rawdevart/build.gradle
deleted file mode 100644
index abd7ba678..000000000
--- a/src/ja/rawdevart/build.gradle
+++ /dev/null
@@ -1,7 +0,0 @@
-ext {
- extName = 'Rawdevart'
- extClass = '.Rawdevart'
- extVersionCode = 4
-}
-
-apply from: "$rootDir/common.gradle"
diff --git a/src/ja/rawdevart/src/eu/kanade/tachiyomi/extension/ja/rawdevart/Rawdevart.kt b/src/ja/rawdevart/src/eu/kanade/tachiyomi/extension/ja/rawdevart/Rawdevart.kt
deleted file mode 100644
index 110297dc5..000000000
--- a/src/ja/rawdevart/src/eu/kanade/tachiyomi/extension/ja/rawdevart/Rawdevart.kt
+++ /dev/null
@@ -1,355 +0,0 @@
-package eu.kanade.tachiyomi.extension.ja.rawdevart
-
-import eu.kanade.tachiyomi.network.GET
-import eu.kanade.tachiyomi.source.model.Filter
-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 eu.kanade.tachiyomi.util.asJsoup
-import okhttp3.HttpUrl.Companion.toHttpUrl
-import okhttp3.OkHttpClient
-import okhttp3.Request
-import okhttp3.Response
-import org.jsoup.nodes.Document
-import org.jsoup.nodes.Element
-import java.text.SimpleDateFormat
-import java.util.Date
-import java.util.Locale
-
-class Rawdevart : ParsedHttpSource() {
-
- override val name = "Rawdevart"
-
- override val baseUrl = "https://rawdevart.com"
-
- override val lang = "ja"
-
- override val supportsLatest = true
-
- override val client: OkHttpClient = network.cloudflareClient
-
- override fun latestUpdatesRequest(page: Int) =
- GET("$baseUrl/comic/?page=$page&lister=0")
-
- override fun latestUpdatesSelector() = "div.row div.hovereffect"
-
- override fun latestUpdatesFromElement(element: Element): SManga {
- val manga = SManga.create()
- val item = element.select("a.head")
- manga.setUrlWithoutDomain(item.attr("href"))
- manga.title = item.text()
- manga.thumbnail_url = element.select("img").attr("abs:src")
-
- return manga
- }
-
- override fun latestUpdatesNextPageSelector() = "li.page-item:not(.disabled) a[aria-label=next]"
-
- override fun popularMangaRequest(page: Int) =
- GET("$baseUrl/comic/?page=$page&lister=5")
-
- override fun popularMangaFromElement(element: Element) = latestUpdatesFromElement(element)
-
- override fun popularMangaSelector() = latestUpdatesSelector()
-
- override fun popularMangaNextPageSelector() = latestUpdatesNextPageSelector()
-
- override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
- val url = "$baseUrl/search/".toHttpUrl().newBuilder()
- url.addQueryParameter("page", page.toString())
- url.addQueryParameter("title", query)
- filters.forEach { filter ->
- when (filter) {
- is AuthorFilter -> {
- url.addQueryParameter("author", filter.state)
- }
- is ArtistFilter -> {
- url.addQueryParameter("artist", filter.state)
- }
- is SortFilter -> {
- url.addQueryParameter("lister", filter.toUriPart())
- }
- is TypeFilter -> {
- val typeToExclude = mutableListOf()
- val typeToInclude = mutableListOf()
- filter.state.forEach { content ->
- if (content.isExcluded()) {
- typeToExclude.add(content.id)
- } else if (content.isIncluded()) {
- typeToInclude.add(content.id)
- }
- }
- if (typeToExclude.isNotEmpty()) {
- url.addQueryParameter(
- "ctype_exc",
- typeToExclude
- .joinToString(","),
- )
- }
- if (typeToInclude.isNotEmpty()) {
- url.addQueryParameter(
- "ctype_inc",
- typeToInclude
- .joinToString(","),
- )
- }
- }
- is StatusFilter -> {
- val statusToExclude = mutableListOf()
- val statusToInclude = mutableListOf()
- filter.state.forEach { content ->
- if (content.isExcluded()) {
- statusToExclude.add(content.id)
- } else if (content.isIncluded()) {
- statusToInclude.add(content.id)
- }
- }
- if (statusToExclude.isNotEmpty()) {
- url.addQueryParameter(
- "status_exc",
- statusToExclude
- .joinToString(","),
- )
- }
- if (statusToInclude.isNotEmpty()) {
- url.addQueryParameter(
- "status_inc",
- statusToInclude
- .joinToString(","),
- )
- }
- }
- is GenreFilter -> {
- val genreToExclude = mutableListOf()
- val genreToInclude = mutableListOf()
- filter.state.forEach { content ->
- if (content.isExcluded()) {
- genreToExclude.add(content.id)
- } else if (content.isIncluded()) {
- genreToInclude.add(content.id)
- }
- }
- if (genreToExclude.isNotEmpty()) {
- url.addQueryParameter(
- "genre_exc",
- genreToExclude
- .joinToString(","),
- )
- }
- if (genreToInclude.isNotEmpty()) {
- url.addQueryParameter(
- "genre_inc",
- genreToInclude
- .joinToString(","),
- )
- }
- }
- else -> {}
- }
- }
-
- return GET(url.build(), headers)
- }
-
- override fun searchMangaSelector() = latestUpdatesSelector()
-
- override fun searchMangaFromElement(element: Element) = latestUpdatesFromElement(element)
-
- override fun searchMangaNextPageSelector() = latestUpdatesNextPageSelector()
-
- override fun mangaDetailsRequest(manga: SManga): Request {
- if (manga.url.startsWith("http")) {
- return GET(manga.url, headers)
- }
- return super.mangaDetailsRequest(manga)
- }
-
- override fun mangaDetailsParse(document: Document): SManga {
- val infoElement = document.select("div.manga-main")
- val manga = SManga.create()
- val status = infoElement.select("th:contains(Status) + td").text()
- val genres = mutableListOf()
- infoElement.select("div.genres a").forEach { element ->
- val genre = element.text()
- genres.add(genre)
- }
- manga.title = infoElement.select("h1").text()
- manga.author = infoElement.select("th:contains(Author) + td").text()
- manga.artist = infoElement.select("th:contains(Artist) + td").text()
- manga.status = parseStatus(status)
- manga.genre = genres.joinToString(", ")
- manga.description = infoElement.select("div.description").text()
- .substringAfter("Description ")
- manga.thumbnail_url = infoElement.select("img.img-fluid.not-lazy").attr("abs:src")
-
- return manga
- }
-
- private fun parseStatus(status: String?) = when {
- status == null -> SManga.UNKNOWN
- status.contains("Ongoing") -> SManga.ONGOING
- status.contains("Finished") -> SManga.COMPLETED
- else -> SManga.UNKNOWN
- }
-
- override fun chapterListRequest(manga: SManga) = chapterListRequest(manga.url, 1)
-
- private fun chapterListRequest(mangaUrl: String, page: Int): Request {
- return GET("$baseUrl$mangaUrl?page=$page", headers)
- }
-
- override fun chapterListSelector() = "div.list-group-item"
-
- override fun chapterListParse(response: Response): List {
- var document = response.asJsoup()
- val chapters = mutableListOf()
- var nextPage = 2
- document.select(chapterListSelector()).map { chapters.add(chapterFromElement(it)) }
- while (document.select(paginationNextPageSelector).isNotEmpty()) {
- val currentPage = document.select("form#filter_form").attr("action")
- document = client.newCall(chapterListRequest(currentPage, nextPage)).execute().asJsoup()
- document.select(chapterListSelector()).map { chapters.add(chapterFromElement(it)) }
- nextPage++
- }
-
- return chapters
- }
-
- private val paginationNextPageSelector = latestUpdatesNextPageSelector()
-
- override fun chapterFromElement(element: Element): SChapter {
- val chapter = SChapter.create()
- chapter.setUrlWithoutDomain(element.select("a").attr("href"))
- chapter.name = element.select("div.rounded-0 span.text-truncate").text()
- chapter.date_upload = element.select("span.mr-2").text().let {
- try {
- when {
- it.contains("ago") -> Date(System.currentTimeMillis() - it.split("\\s".toRegex())[0].toLong() * 60 * 60 * 1000).time
- it.contains("Yesterday") -> Date(System.currentTimeMillis() - 24 * 60 * 60 * 1000).time
- it.contains(".") -> SimpleDateFormat("MMM. dd, yyyy", Locale.US).parse(it)?.time ?: 0L
- else -> SimpleDateFormat("yyyy-MM-dd", Locale.US).parse(it)?.time ?: 0L
- }
- } catch (e: Exception) {
- Date(System.currentTimeMillis()).time
- }
- }
-
- return chapter
- }
-
- override fun pageListParse(document: Document): List {
- val pages = mutableListOf()
- document.select("img.not-lazy[data-src]").forEachIndexed { i, img ->
- pages.add(Page(i, "", img.attr("data-src")))
- }
- return pages
- }
-
- override fun imageUrlParse(document: Document): String = throw UnsupportedOperationException()
-
- private class AuthorFilter : Filter.Text("Author")
-
- private class ArtistFilter : Filter.Text("Artist")
-
- private class SortFilter : UriPartFilter(
- "Sort By",
- arrayOf(
- Pair("