sngm: fix missing chapters (#593)

* sngm: fix missing chapters

* add back comment
This commit is contained in:
beerpsi 2024-01-25 03:37:51 +07:00 committed by Draff
parent 8938b92e09
commit 1d563cd3ca
2 changed files with 8 additions and 3 deletions

View File

@ -27,7 +27,7 @@ class Shinigami : Madara("Shinigami", "https://shinigamitoon.com", "id") {
add("Sec-Fetch-Mode", "navigate")
add("Sec-Fetch-Site", "same-origin")
add("Upgrade-Insecure-Requests", "1")
add("X-Requested-With", "") // added for webview, and removed in interceptor for normal use
add("X-Requested-With", randomString((1..20).random())) // added for webview, and removed in interceptor for normal use
}
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
@ -51,7 +51,7 @@ class Shinigami : Madara("Shinigami", "https://shinigamitoon.com", "id") {
// Tags are useless as they are just SEO keywords.
override val mangaDetailsSelectorTag = ""
override val chapterUrlSelector = "a:not([href*=troll-page])"
override val chapterUrlSelector = "div.chapter-link:not([style~=display:\\snone]) a"
override fun chapterFromElement(element: Element): SChapter = SChapter.create().apply {
val urlElement = element.selectFirst(chapterUrlSelector)!!
@ -107,6 +107,11 @@ class Shinigami : Madara("Shinigami", "https://shinigamitoon.com", "id") {
.toByteArray()
}
private fun randomString(length: Int): String {
val charPool = ('a'..'z') + ('A'..'Z')
return List(length) { charPool.random() }.joinToString("")
}
companion object {
private val KEY_REGEX by lazy { Regex("""_id\s+\+\s+'(.*?)'\s+\+\s+post_id\s+\+\s+'(.*?)'\s+\+\s+post_id""") }
private val CHAPTER_DATA_REGEX by lazy { Regex("""var chapter_data\s*=\s*'(.*?)'""") }

View File

@ -442,7 +442,7 @@ class MadaraGenerator : ThemeSourceGenerator {
SingleLang("Shayami", "https://shayami.com", "es"),
SingleLang("Shiba Manga", "https://shibamanga.com", "en"),
SingleLang("Shield Manga", "https://shieldmanga.io", "en", overrideVersionCode = 3),
SingleLang("Shinigami", "https://shinigamitoon.com", "id", overrideVersionCode = 13),
SingleLang("Shinigami", "https://shinigamitoon.com", "id", overrideVersionCode = 14),
SingleLang("Shooting Star Scans", "https://shootingstarscans.com", "en"),
SingleLang("ShoujoHearts", "https://shoujohearts.com", "en", overrideVersionCode = 2),
SingleLang("Sinensis Scan", "https://sinensisscan.net", "pt-BR", pkgName = "sinensis", overrideVersionCode = 6),