JManga: remove extension (#4866)

This commit is contained in:
dngonz 2024-09-01 09:16:00 +02:00 committed by Draff
parent 07a8f8fe9e
commit 7d7a127ae2
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
7 changed files with 0 additions and 144 deletions

View File

@ -1,9 +0,0 @@
ext {
extName = 'JManga'
extClass = '.JManga'
themePkg = 'wpcomics'
baseUrl = 'https://jmanga.vip'
overrideVersionCode = 1
}
apply from: "$rootDir/common.gradle"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

View File

@ -1,135 +0,0 @@
package eu.kanade.tachiyomi.extension.ja.jmanga
import eu.kanade.tachiyomi.multisrc.wpcomics.WPComics
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
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.Calendar
import java.util.Locale
class JManga : WPComics(
"JManga",
"https://jmanga.vip",
"ja",
dateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'", Locale.JAPANESE),
gmtOffset = null,
) {
override fun popularMangaSelector() = "div.items article.item"
override fun popularMangaNextPageSelector() = "li.active + li.page-item a.page-link"
override fun mangaDetailsParse(document: Document): SManga {
return SManga.create().apply {
document.select("article#item-detail").let { info ->
author = info.select("li.author p.col-xs-8").text()
status = info.select("li.status p.col-xs-8").text().toStatus()
genre = info.select("li.kind p.col-xs-8 a").joinToString { it.text() }
val otherName = info.select("h2.other-name").text()
description = info.select("div.detail-content").text() +
if (otherName.isNotBlank()) "\n\n ${intl["OTHER_NAME"]}: $otherName" else ""
thumbnail_url = imageOrNull(info[0].selectFirst("div.col-image img")!!)
}
}
}
override val searchPath = "search/manga"
override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request {
val filterList = filters.let { if (it.isEmpty()) getFilterList() else it }
val url = "$baseUrl/$searchPath".toHttpUrl().newBuilder()
filterList.forEach { filter ->
when (filter) {
is GenreFilter -> filter.toUriPart()?.let { url.addQueryParameter("genre", it) }
is StatusFilter -> filter.toUriPart()?.let { url.addQueryParameter("status", it) }
else -> {}
}
}
url.apply {
addQueryParameter(queryParam, query)
addQueryParameter("page", page.toString())
addQueryParameter("sort", "-1")
}
return GET(url.build(), headers)
}
override fun chapterFromElement(element: Element): SChapter {
val minuteWords = listOf("minute", "")
val hourWords = listOf("hour", "時間")
val dayWords = listOf("day", "")
val weekWords = listOf("week", "週間")
val monthWords = listOf("month", "")
val chapterDate = element.select("div.col-xs-4").text()
return SChapter.create().apply {
element.select("a").let {
name = it.text()
setUrlWithoutDomain(it.attr("href"))
}
try {
val trimmedDate = chapterDate.substringBefore("").split(" ")
val calendar = Calendar.getInstance()
when {
monthWords.any {
trimmedDate[1].contains(
it,
ignoreCase = true,
)
} -> calendar.apply { add(Calendar.MONTH, -trimmedDate[0].toInt()) }
weekWords.any {
trimmedDate[1].contains(
it,
ignoreCase = true,
)
} -> calendar.apply { add(Calendar.WEEK_OF_MONTH, -trimmedDate[0].toInt()) }
dayWords.any {
trimmedDate[1].contains(
it,
ignoreCase = true,
)
} -> calendar.apply { add(Calendar.DAY_OF_MONTH, -trimmedDate[0].toInt()) }
hourWords.any {
trimmedDate[1].contains(
it,
ignoreCase = true,
)
} -> calendar.apply { add(Calendar.HOUR_OF_DAY, -trimmedDate[0].toInt()) }
minuteWords.any {
trimmedDate[1].contains(
it,
ignoreCase = true,
)
} -> calendar.apply { add(Calendar.MINUTE, -trimmedDate[0].toInt()) }
}
date_upload = calendar.timeInMillis
} catch (_: Exception) {
date_upload = 0L
}
}
}
override fun getStatusList(): List<Pair<String?, String>> =
listOf(
Pair("-1", "全て"),
Pair("0", "完結済み"),
Pair("1", "連載中"),
)
override val genresSelector = ".genres ul.nav li:not(.active) a"
override val genresUrlDelimiter = "="
}