xoxo: update url (#16902)

* XoXo: update url

* fix date parsing
This commit is contained in:
AwkwardPeak7 2023-06-29 20:14:52 +05:00 committed by GitHub
parent 6a106c8648
commit fe7559b06f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 3 deletions

View File

@ -13,7 +13,7 @@ import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.util.Locale
class XoxoComics : WPComics("XOXO Comics", "https://xoxocomics.com", "en", SimpleDateFormat("MM/dd/yy", Locale.US), null) {
class XoxoComics : WPComics("XOXO Comics", "https://xoxocomics.net", "en", SimpleDateFormat("MM/dd/yyyy", Locale.US), null) {
override fun latestUpdatesRequest(page: Int): Request = GET("$baseUrl/comic-updates?page=$page", headers)
override fun latestUpdatesSelector() = "li.row"
override fun latestUpdatesFromElement(element: Element): SManga {
@ -43,5 +43,12 @@ class XoxoComics : WPComics("XOXO Comics", "https://xoxocomics.com", "en", Simpl
parseChapters(response.asJsoup())
return chapters
}
override fun chapterFromElement(element: Element): SChapter {
return super.chapterFromElement(element).apply {
date_upload = element.select("div.col-xs-3").text().toDate()
}
}
override fun pageListRequest(chapter: SChapter): Request = GET(baseUrl + "${chapter.url}/all")
}

View File

@ -153,7 +153,7 @@ abstract class WPComics(
private val currentYear by lazy { Calendar.getInstance(Locale.US)[1].toString().takeLast(2) }
private fun String?.toDate(): Long {
protected fun String?.toDate(): Long {
this ?: return 0
val secondWords = listOf("second", "giây")

View File

@ -15,7 +15,7 @@ class WPComicsGenerator : ThemeSourceGenerator {
SingleLang("NetTruyen", "https://www.nettruyenmax.com", "vi", overrideVersionCode = 18),
SingleLang("NhatTruyen", "https://nhattruyenmin.com", "vi", overrideVersionCode = 11),
SingleLang("TruyenChon", "http://truyenchon.com", "vi", overrideVersionCode = 3),
SingleLang("XOXO Comics", "https://xoxocomics.com", "en", className = "XoxoComics", overrideVersionCode = 1),
SingleLang("XOXO Comics", "https://xoxocomics.net", "en", className = "XoxoComics", overrideVersionCode = 2),
)
companion object {