Initial commit
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 8.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 34 KiB |
BIN
multisrc/overrides/madara/manhwalatino/res/web_hi_res_512.png
Normal file
BIN
multisrc/overrides/madara/manhwalatino/res/web_hi_res_512.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 202 KiB |
64
multisrc/overrides/madara/manhwalatino/src/ManhwaLatino.kt
Normal file
64
multisrc/overrides/madara/manhwalatino/src/ManhwaLatino.kt
Normal file
@@ -0,0 +1,64 @@
|
||||
package eu.kanade.tachiyomi.extension.es.manhwalatino
|
||||
|
||||
import eu.kanade.tachiyomi.multisrc.madara.Madara
|
||||
import eu.kanade.tachiyomi.source.model.SChapter
|
||||
import okhttp3.MediaType.Companion.toMediaTypeOrNull
|
||||
import okhttp3.OkHttpClient
|
||||
import okhttp3.ResponseBody.Companion.toResponseBody
|
||||
import org.jsoup.nodes.Element
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
|
||||
class ManhwaLatino : Madara(
|
||||
"Manhwa-Latino",
|
||||
"https://manhwa-latino.com",
|
||||
"es",
|
||||
SimpleDateFormat("dd/MM/yyyy", Locale("es")),
|
||||
) {
|
||||
|
||||
override val client: OkHttpClient = super.client.newBuilder()
|
||||
.addInterceptor { chain ->
|
||||
val request = chain.request()
|
||||
val headers = request.headers.newBuilder()
|
||||
.removeAll("Accept-Encoding")
|
||||
.build()
|
||||
val response = chain.proceed(request.newBuilder().headers(headers).build())
|
||||
if (response.headers("Content-Type").contains("application/octet-stream") && response.request.url.toString().endsWith(".jpg")) {
|
||||
val orgBody = response.body.bytes()
|
||||
val newBody = orgBody.toResponseBody("image/jpeg".toMediaTypeOrNull())
|
||||
response.newBuilder()
|
||||
.body(newBody)
|
||||
.build()
|
||||
} else {
|
||||
response
|
||||
}
|
||||
}
|
||||
.build()
|
||||
|
||||
override val useNewChapterEndpoint = true
|
||||
|
||||
override val chapterUrlSelector = "div.mini-letters > a"
|
||||
|
||||
override val mangaDetailsSelectorStatus = "div.post-content_item:contains(Estado del comic) > div.summary-content"
|
||||
override val mangaDetailsSelectorDescription = "div.post-content_item:contains(Resumen) div.summary-container"
|
||||
override val pageListParseSelector = "div.page-break img.wp-manga-chapter-img"
|
||||
|
||||
override fun chapterFromElement(element: Element): SChapter {
|
||||
val chapter = SChapter.create()
|
||||
|
||||
with(element) {
|
||||
select(chapterUrlSelector).first()?.let { urlElement ->
|
||||
chapter.url = urlElement.attr("abs:href").let {
|
||||
it.substringBefore("?style=paged") + if (!it.endsWith(chapterUrlSuffix)) chapterUrlSuffix else ""
|
||||
}
|
||||
chapter.name = urlElement.wholeText().substringAfter("\n")
|
||||
}
|
||||
|
||||
chapter.date_upload = select("img:not(.thumb)").firstOrNull()?.attr("alt")?.let { parseRelativeDate(it) }
|
||||
?: select("span a").firstOrNull()?.attr("title")?.let { parseRelativeDate(it) }
|
||||
?: parseChapterDate(select(chapterDateSelector()).firstOrNull()?.text())
|
||||
}
|
||||
|
||||
return chapter
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user