Initial commit
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 7.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 41 KiB |
BIN
multisrc/overrides/madara/cattranslator/res/web_hi_res_512.png
Normal file
BIN
multisrc/overrides/madara/cattranslator/res/web_hi_res_512.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 345 KiB |
33
multisrc/overrides/madara/cattranslator/src/CatTranslator.kt
Normal file
33
multisrc/overrides/madara/cattranslator/src/CatTranslator.kt
Normal file
@@ -0,0 +1,33 @@
|
||||
package eu.kanade.tachiyomi.extension.th.cattranslator
|
||||
|
||||
import eu.kanade.tachiyomi.multisrc.madara.Madara
|
||||
import eu.kanade.tachiyomi.source.model.SManga
|
||||
import org.jsoup.nodes.Element
|
||||
|
||||
class CatTranslator : Madara(
|
||||
"CAT-translator",
|
||||
"https://cats-translator.com/manga",
|
||||
"th",
|
||||
) {
|
||||
private fun parseMangaFromElement(element: Element, isSearch: Boolean): SManga {
|
||||
val manga = SManga.create()
|
||||
|
||||
with(element) {
|
||||
select(if (isSearch) "div.post-title a" else popularMangaUrlSelector).first()?.let {
|
||||
manga.setUrlWithoutDomain(it.attr("abs:href"))
|
||||
manga.url = manga.url.removePrefix("/manga")
|
||||
manga.title = it.ownText()
|
||||
}
|
||||
|
||||
select("img").first()?.let {
|
||||
manga.thumbnail_url = imageFromElement(it)
|
||||
}
|
||||
}
|
||||
|
||||
return manga
|
||||
}
|
||||
|
||||
override fun popularMangaFromElement(element: Element) = parseMangaFromElement(element, false)
|
||||
|
||||
override fun searchMangaFromElement(element: Element) = parseMangaFromElement(element, true)
|
||||
}
|
||||
Reference in New Issue
Block a user