|
|
|
|
@ -124,7 +124,9 @@ internal abstract class MadaraParser(
|
|
|
|
|
|
|
|
|
|
// Change these values only if the site does not support manga listings via ajax
|
|
|
|
|
protected open val withoutAjax = false
|
|
|
|
|
protected open val listeurl = "manga/"
|
|
|
|
|
|
|
|
|
|
// can be changed to retrieve tags see getTags
|
|
|
|
|
protected open val listUrl = "manga/"
|
|
|
|
|
|
|
|
|
|
override suspend fun getListPage(
|
|
|
|
|
page: Int,
|
|
|
|
|
@ -160,7 +162,7 @@ internal abstract class MadaraParser(
|
|
|
|
|
|
|
|
|
|
else -> {
|
|
|
|
|
|
|
|
|
|
append("/$listeurl")
|
|
|
|
|
append("/$listUrl")
|
|
|
|
|
append("/page/")
|
|
|
|
|
append(pages.toString())
|
|
|
|
|
append("?")
|
|
|
|
|
@ -233,7 +235,7 @@ internal abstract class MadaraParser(
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
override suspend fun getTags(): Set<MangaTag> {
|
|
|
|
|
val doc = webClient.httpGet("https://$domain/manga/").parseHtml()
|
|
|
|
|
val doc = webClient.httpGet("https://$domain/$listUrl").parseHtml()
|
|
|
|
|
val body = doc.body()
|
|
|
|
|
val root1 = body.selectFirst("header")?.selectFirst("ul.second-menu")
|
|
|
|
|
val root2 = body.selectFirst("div.genres_wrap")?.selectFirst("ul.list-unstyled")
|
|
|
|
|
@ -431,31 +433,31 @@ internal abstract class MadaraParser(
|
|
|
|
|
val d = date?.lowercase() ?: return 0
|
|
|
|
|
return when {
|
|
|
|
|
d.endsWith(" ago") || d.endsWith(" atrás") || // Handle translated 'ago' in Portuguese.
|
|
|
|
|
d.startsWith("há ") || // other translated 'ago' in Portuguese.
|
|
|
|
|
d.endsWith(" hace") || // other translated 'ago' in Spanish
|
|
|
|
|
d.endsWith(" назад") || // other translated 'ago' in Russian
|
|
|
|
|
d.endsWith(" önce") || // Handle translated 'ago' in Turkish.
|
|
|
|
|
d.endsWith(" trước") || // Handle translated 'ago' in Viêt Nam.
|
|
|
|
|
d.startsWith("il y a") || // Handle translated 'ago' in French.
|
|
|
|
|
//If there is no ago but just a motion of time
|
|
|
|
|
// short Hours
|
|
|
|
|
d.endsWith(" h") ||
|
|
|
|
|
// short Day
|
|
|
|
|
d.endsWith(" d") ||
|
|
|
|
|
// Day in Portuguese
|
|
|
|
|
d.endsWith(" días") || d.endsWith(" día") ||
|
|
|
|
|
// Day in French
|
|
|
|
|
d.endsWith(" jour") || d.endsWith(" jours") ||
|
|
|
|
|
// Hours in Portuguese
|
|
|
|
|
d.endsWith(" horas") || d.endsWith(" hora") ||
|
|
|
|
|
// Hours in french
|
|
|
|
|
d.endsWith(" heure") || d.endsWith(" heures") ||
|
|
|
|
|
// Minutes in English
|
|
|
|
|
d.endsWith(" mins") ||
|
|
|
|
|
// Minutes in Portuguese
|
|
|
|
|
d.endsWith(" minutos") || d.endsWith(" minuto") ||
|
|
|
|
|
//Minutes in French
|
|
|
|
|
d.endsWith(" minute") || d.endsWith(" minutes") -> parseRelativeDate(date)
|
|
|
|
|
d.startsWith("há ") || // other translated 'ago' in Portuguese.
|
|
|
|
|
d.endsWith(" hace") || // other translated 'ago' in Spanish
|
|
|
|
|
d.endsWith(" назад") || // other translated 'ago' in Russian
|
|
|
|
|
d.endsWith(" önce") || // Handle translated 'ago' in Turkish.
|
|
|
|
|
d.endsWith(" trước") || // Handle translated 'ago' in Viêt Nam.
|
|
|
|
|
d.startsWith("il y a") || // Handle translated 'ago' in French.
|
|
|
|
|
//If there is no ago but just a motion of time
|
|
|
|
|
// short Hours
|
|
|
|
|
d.endsWith(" h") ||
|
|
|
|
|
// short Day
|
|
|
|
|
d.endsWith(" d") ||
|
|
|
|
|
// Day in Portuguese
|
|
|
|
|
d.endsWith(" días") || d.endsWith(" día") ||
|
|
|
|
|
// Day in French
|
|
|
|
|
d.endsWith(" jour") || d.endsWith(" jours") ||
|
|
|
|
|
// Hours in Portuguese
|
|
|
|
|
d.endsWith(" horas") || d.endsWith(" hora") ||
|
|
|
|
|
// Hours in french
|
|
|
|
|
d.endsWith(" heure") || d.endsWith(" heures") ||
|
|
|
|
|
// Minutes in English
|
|
|
|
|
d.endsWith(" mins") ||
|
|
|
|
|
// Minutes in Portuguese
|
|
|
|
|
d.endsWith(" minutos") || d.endsWith(" minuto") ||
|
|
|
|
|
//Minutes in French
|
|
|
|
|
d.endsWith(" minute") || d.endsWith(" minutes") -> parseRelativeDate(date)
|
|
|
|
|
|
|
|
|
|
// Handle 'yesterday' and 'today', using midnight
|
|
|
|
|
d.startsWith("year") -> Calendar.getInstance().apply {
|
|
|
|
|
@ -552,10 +554,10 @@ internal abstract class MadaraParser(
|
|
|
|
|
|
|
|
|
|
private fun createRequestTemplate() =
|
|
|
|
|
("action=madara_load_more&page=1&template=madara-core%2Fcontent%2Fcontent-search&vars%5Bs%5D=&vars%5B" +
|
|
|
|
|
"orderby%5D=meta_value_num&vars%5Bpaged%5D=1&vars%5Btemplate%5D=search&vars%5Bmeta_query" +
|
|
|
|
|
"%5D%5B0%5D%5Brelation%5D=AND&vars%5Bmeta_query%5D%5Brelation%5D=OR&vars%5Bpost_type" +
|
|
|
|
|
"%5D=wp-manga&vars%5Bpost_status%5D=publish&vars%5Bmeta_key%5D=_latest_update&vars%5Border" +
|
|
|
|
|
"%5D=desc&vars%5Bmanga_archives_item_layout%5D=default").split(
|
|
|
|
|
"orderby%5D=meta_value_num&vars%5Bpaged%5D=1&vars%5Btemplate%5D=search&vars%5Bmeta_query" +
|
|
|
|
|
"%5D%5B0%5D%5Brelation%5D=AND&vars%5Bmeta_query%5D%5Brelation%5D=OR&vars%5Bpost_type" +
|
|
|
|
|
"%5D=wp-manga&vars%5Bpost_status%5D=publish&vars%5Bmeta_key%5D=_latest_update&vars%5Border" +
|
|
|
|
|
"%5D=desc&vars%5Bmanga_archives_item_layout%5D=default").split(
|
|
|
|
|
'&',
|
|
|
|
|
).map {
|
|
|
|
|
val pos = it.indexOf('=')
|
|
|
|
|
|