Update Manga-raw.club (#7254)
* [EN] manga-raw.club extension implementation * Added nsfw tag * Change to get correct description and if date parse fails returns 0 * update extension version number * Date is now parsed always with English Locale * Fixed Status to show correctly
This commit is contained in:
parent
a603e15b50
commit
a5836c534b
|
@ -5,7 +5,7 @@ ext {
|
||||||
extName = 'manga-raw.club'
|
extName = 'manga-raw.club'
|
||||||
pkgNameSuffix = 'en.mangarawclub'
|
pkgNameSuffix = 'en.mangarawclub'
|
||||||
extClass = '.MangaRawClub'
|
extClass = '.MangaRawClub'
|
||||||
extVersionCode = 1
|
extVersionCode = 2
|
||||||
libVersion = '1.2'
|
libVersion = '1.2'
|
||||||
containsNsfw = true
|
containsNsfw = true
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,21 +84,20 @@ class MangaRawClub : ParsedHttpSource() {
|
||||||
genres.add(genre)
|
genres.add(genre)
|
||||||
}
|
}
|
||||||
manga.genre = genres.joinToString(", ")
|
manga.genre = genres.joinToString(", ")
|
||||||
manga.status = parseStatus(document.select("h5:contains(Status) + div").text())
|
val status = when {
|
||||||
|
document.select("div.header-stats").select("strong.completed").first() != null -> SManga.COMPLETED
|
||||||
|
document.select("div.header-stats").select("strong.ongoing").first() != null -> SManga.ONGOING
|
||||||
|
else -> SManga.UNKNOWN
|
||||||
|
}
|
||||||
|
manga.status = status
|
||||||
manga.description = document.getElementsByClass("description").first().text()
|
manga.description = document.getElementsByClass("description").first().text()
|
||||||
|
manga.description = document.select("div.summary > div.content").first().text()
|
||||||
val coverElement = document.getElementsByClass("cover")
|
val coverElement = document.getElementsByClass("cover")
|
||||||
manga.thumbnail_url = baseUrl + coverElement.select("img").attr("data-src")
|
manga.thumbnail_url = baseUrl + coverElement.select("img").attr("data-src")
|
||||||
|
|
||||||
return manga
|
return manga
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun parseStatus(element: String): Int = when {
|
|
||||||
|
|
||||||
element.toLowerCase(Locale.getDefault()).contains("publishing") -> SManga.ONGOING
|
|
||||||
element.toLowerCase(Locale.getDefault()).contains("finished") -> SManga.COMPLETED
|
|
||||||
else -> SManga.UNKNOWN
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun chapterListSelector() = "ul.chapter-list > li"
|
override fun chapterListSelector() = "ul.chapter-list > li"
|
||||||
|
|
||||||
override fun chapterFromElement(element: Element): SChapter {
|
override fun chapterFromElement(element: Element): SChapter {
|
||||||
|
@ -117,15 +116,18 @@ class MangaRawClub : ParsedHttpSource() {
|
||||||
val fdate = date.replace(".", "").replace("Sept", "Sep")
|
val fdate = date.replace(".", "").replace("Sept", "Sep")
|
||||||
val format = "MMMMM dd, yyyy, h:mm a"
|
val format = "MMMMM dd, yyyy, h:mm a"
|
||||||
val format2 = "MMMMM dd, yyyy, h a" // because sometimes if it is exact hour it wont have minutes because why not
|
val format2 = "MMMMM dd, yyyy, h a" // because sometimes if it is exact hour it wont have minutes because why not
|
||||||
val sdf = SimpleDateFormat(format)
|
val sdf = SimpleDateFormat(format, Locale.ENGLISH)
|
||||||
|
try {
|
||||||
return try {
|
return try {
|
||||||
val value = sdf.parse(fdate)
|
val value = sdf.parse(fdate)
|
||||||
value!!.time
|
value!!.time
|
||||||
|
} catch (e: ParseException) {
|
||||||
|
val sdfF = SimpleDateFormat(format2, Locale.ENGLISH)
|
||||||
|
val value = sdfF.parse(fdate)
|
||||||
|
value!!.time
|
||||||
|
}
|
||||||
} catch (e: ParseException) {
|
} catch (e: ParseException) {
|
||||||
val sdfF = SimpleDateFormat(format2)
|
return 0
|
||||||
val value = sdfF.parse(fdate)
|
|
||||||
value!!.time
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue