Add WeLoveMangaOne. (#14630)
This commit is contained in:
parent
d24ca6d0a8
commit
9483256432
|
@ -0,0 +1,44 @@
|
||||||
|
package eu.kanade.tachiyomi.extension.ja.welovemangaone
|
||||||
|
|
||||||
|
import eu.kanade.tachiyomi.multisrc.fmreader.FMReader
|
||||||
|
import eu.kanade.tachiyomi.network.GET
|
||||||
|
import eu.kanade.tachiyomi.source.model.SChapter
|
||||||
|
import org.jsoup.nodes.Element
|
||||||
|
import java.util.Calendar
|
||||||
|
|
||||||
|
class WeLoveMangaOne : FMReader("WeLoveMangaOne", "https://welovemanga.one", "ja") {
|
||||||
|
override fun latestUpdatesRequest(page: Int) =
|
||||||
|
GET("$baseUrl/manga-list.html?page=$page&sort=last_update")
|
||||||
|
|
||||||
|
override fun chapterFromElement(element: Element, mangaTitle: String): SChapter {
|
||||||
|
return SChapter.create().apply {
|
||||||
|
element.let {
|
||||||
|
setUrlWithoutDomain(it.attr("abs:href"))
|
||||||
|
name = it.attr("title")
|
||||||
|
}
|
||||||
|
|
||||||
|
date_upload = element.select(chapterTimeSelector)
|
||||||
|
.let { if (it.hasText()) parseChapterDate(it.text()) else 0 }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun parseChapterDate(date: String): Long {
|
||||||
|
val value = date.split(' ')[dateValueIndex].toInt()
|
||||||
|
val chapterDate = Calendar.getInstance().apply {
|
||||||
|
set(Calendar.SECOND, 0)
|
||||||
|
set(Calendar.MILLISECOND, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
when (date.split(' ')[dateWordIndex]) {
|
||||||
|
"mins", "minutes" -> chapterDate.add(Calendar.MINUTE, value * -1)
|
||||||
|
"hours" -> chapterDate.add(Calendar.HOUR_OF_DAY, value * -1)
|
||||||
|
"days" -> chapterDate.add(Calendar.DATE, value * -1)
|
||||||
|
"weeks" -> chapterDate.add(Calendar.DATE, value * 7 * -1)
|
||||||
|
"months" -> chapterDate.add(Calendar.MONTH, value * -1)
|
||||||
|
"years" -> chapterDate.add(Calendar.YEAR, value * -1)
|
||||||
|
else -> return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
return chapterDate.timeInMillis
|
||||||
|
}
|
||||||
|
}
|
|
@ -23,6 +23,7 @@ class FMReaderGenerator : ThemeSourceGenerator {
|
||||||
SingleLang("Say Truyen", "https://saytruyen.net", "vi", overrideVersionCode = 2),
|
SingleLang("Say Truyen", "https://saytruyen.net", "vi", overrideVersionCode = 2),
|
||||||
SingleLang("WeLoveManga", "https://weloma.art", "ja", pkgName = "rawlh", overrideVersionCode = 4),
|
SingleLang("WeLoveManga", "https://weloma.art", "ja", pkgName = "rawlh", overrideVersionCode = 4),
|
||||||
SingleLang("Manga1000", "https://manga1000.top", "ja"),
|
SingleLang("Manga1000", "https://manga1000.top", "ja"),
|
||||||
|
SingleLang("WeLoveMangaOne", "https://welovemanga.one", "ja"),
|
||||||
)
|
)
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
Loading…
Reference in New Issue