parent
7bf5ecaf4c
commit
2450e6e69d
|
@ -5,7 +5,7 @@ ext {
|
||||||
appName = 'Tachiyomi: MangaPark'
|
appName = 'Tachiyomi: MangaPark'
|
||||||
pkgNameSuffix = 'en.mangapark'
|
pkgNameSuffix = 'en.mangapark'
|
||||||
extClass = '.MangaPark'
|
extClass = '.MangaPark'
|
||||||
extVersionCode = 3
|
extVersionCode = 4
|
||||||
libVersion = '1.0'
|
libVersion = '1.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,18 +10,15 @@ import org.jsoup.nodes.Element
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
/**
|
|
||||||
* MangaPark source
|
|
||||||
*/
|
|
||||||
|
|
||||||
class MangaPark : ParsedHttpSource() {
|
class MangaPark : ParsedHttpSource() {
|
||||||
|
|
||||||
override val lang = "en"
|
override val lang = "en"
|
||||||
|
|
||||||
override val supportsLatest = true
|
override val supportsLatest = true
|
||||||
override val name = "MangaPark"
|
override val name = "MangaPark"
|
||||||
override val baseUrl = "https://mangapark.me"
|
override val baseUrl = "https://mangapark.me"
|
||||||
|
|
||||||
private val directorySelector = ".item"
|
private val directorySelector = ".ls1 .item"
|
||||||
private val directoryUrl = "/genre"
|
private val directoryUrl = "/genre"
|
||||||
private val directoryNextPageSelector = ".paging.full > li:last-child > a"
|
private val directoryNextPageSelector = ".paging.full > li:last-child > a"
|
||||||
|
|
||||||
|
@ -37,9 +34,7 @@ class MangaPark : ParsedHttpSource() {
|
||||||
private fun mangaFromElement(element: Element) = SManga.create().apply {
|
private fun mangaFromElement(element: Element) = SManga.create().apply {
|
||||||
val coverElement = element.getElementsByClass("cover").first()
|
val coverElement = element.getElementsByClass("cover").first()
|
||||||
url = coverElement.attr("href")
|
url = coverElement.attr("href")
|
||||||
|
|
||||||
title = coverElement.attr("title")
|
title = coverElement.attr("title")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun popularMangaFromElement(element: Element) = mangaFromElement(element)
|
override fun popularMangaFromElement(element: Element) = mangaFromElement(element)
|
||||||
|
@ -112,13 +107,10 @@ class MangaPark : ParsedHttpSource() {
|
||||||
//TODO Maybe make it possible for users to view the other versions as well?
|
//TODO Maybe make it possible for users to view the other versions as well?
|
||||||
override fun chapterListSelector() = ".stream .volume .chapter li"
|
override fun chapterListSelector() = ".stream .volume .chapter li"
|
||||||
|
|
||||||
|
|
||||||
override fun chapterFromElement(element: Element) = SChapter.create().apply {
|
override fun chapterFromElement(element: Element) = SChapter.create().apply {
|
||||||
url = element.select("em > a").last().attr("href")
|
url = element.select(".tit > a").first().attr("href")
|
||||||
|
name = element.select(".tit > a").first().text()
|
||||||
name = element.select("li span").first().text()
|
date_upload = parseDate(element.select(".time").first().text().trim())
|
||||||
|
|
||||||
date_upload = parseDate(element.getElementsByTag("i").text().trim())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun parseDate(date: String): Long {
|
private fun parseDate(date: String): Long {
|
||||||
|
@ -158,7 +150,10 @@ class MangaPark : ParsedHttpSource() {
|
||||||
|
|
||||||
if (trimmedDate[2] != "ago") return 0
|
if (trimmedDate[2] != "ago") return 0
|
||||||
|
|
||||||
val number = trimmedDate[0].toIntOrNull() ?: return 0
|
val number = when (trimmedDate[0]) {
|
||||||
|
"a" -> 1
|
||||||
|
else -> trimmedDate[0].toIntOrNull() ?: return 0
|
||||||
|
}
|
||||||
val unit = trimmedDate[1].removeSuffix("s") //Remove 's' suffix
|
val unit = trimmedDate[1].removeSuffix("s") //Remove 's' suffix
|
||||||
|
|
||||||
val now = Calendar.getInstance()
|
val now = Calendar.getInstance()
|
||||||
|
|
Loading…
Reference in New Issue