Add Hentaing (#3885)

* Add Hentaing

* remove page if imageUrl is null also
This commit is contained in:
Vetle Ledaal 2024-07-06 13:11:11 +02:00 committed by Draff
parent 102b91f959
commit 8dc7c90005
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
7 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,10 @@
ext {
extName = 'Hentaing'
extClass = '.Hentaing'
themePkg = 'madara'
baseUrl = 'https://hentaing.org'
overrideVersionCode = 0
isNsfw = true
}
apply from: "$rootDir/common.gradle"

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View File

@ -0,0 +1,32 @@
package eu.kanade.tachiyomi.extension.tr.hentaing
import eu.kanade.tachiyomi.multisrc.madara.Madara
import eu.kanade.tachiyomi.source.model.Page
import org.jsoup.nodes.Document
import java.text.SimpleDateFormat
import java.util.Locale
class Hentaing : Madara(
"Hentaing",
"https://hentaing.org",
"tr",
dateFormat = SimpleDateFormat("MMMM d, yyyy", Locale("tr")),
) {
override val useLoadMoreRequest = LoadMoreStrategy.Always
override val useNewChapterEndpoint = true
override fun pageListParse(document: Document): List<Page> {
val pageList = super.pageListParse(document)
if (
pageList.isEmpty() &&
document.select(".content-blocked, .login-required").isNotEmpty()
) {
throw Exception("Okumak için WebView üzerinden giriş yapın")
}
return pageList.filterNot { it.imageUrl?.let(patternBadImage::containsMatchIn) ?: true }
}
private val patternBadImage = """/\.(?:webp|jpeg|tiff|.{3})$""".toRegex()
}