Doujindesu: fix no page found (#19289)

* Doujindesu: fix no page found

* added randomua

* fix package name

* comply wit review

---------

Co-authored-by: ghost <ghost@gmail.com>
This commit is contained in:
Sofie 2023-12-14 17:57:14 +07:00 committed by GitHub
parent 04ce77c510
commit 99f5621392
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 24 additions and 4 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

View File

@ -0,0 +1,11 @@
package eu.kanade.tachiyomi.extension.id.komiktap
import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient
class Komiktap : MangaThemesia("Komiktap", "https://komiktap.me", "id") {
override val client: OkHttpClient = super.client.newBuilder()
.rateLimit(4)
.build()
}

View File

@ -64,6 +64,7 @@ class MangaThemesiaGenerator : ThemeSourceGenerator {
SingleLang("KomikIndo.co", "https://komikindo.co", "id", className = "KomikindoCo", overrideVersionCode = 3),
SingleLang("KomikMama", "https://komikmama.co", "id", overrideVersionCode = 1),
SingleLang("KomikManhwa", "https://komikmanhwa.me", "id", isNsfw = true),
SingleLang("Komiktap", "https://komiktap.me", "id", isNsfw = true),
SingleLang("Komiksan", "https://komiksan.link", "id", overrideVersionCode = 2),
SingleLang("Komiku.com", "https://komiku.com", "id", className = "KomikuCom"),
SingleLang("Kuma Scans (Kuma Translation)", "https://kumascans.com", "en", className = "KumaScans", overrideVersionCode = 1),

View File

@ -5,8 +5,12 @@ ext {
extName = 'DoujinDesu'
pkgNameSuffix = 'id.doujindesu'
extClass = '.DoujinDesu'
extVersionCode = 5
extVersionCode = 6
isNsfw = true
}
dependencies {
implementation(project(":lib-randomua"))
}
apply from: "$rootDir/common.gradle"

View File

@ -6,6 +6,7 @@ import android.widget.Toast
import androidx.preference.EditTextPreference
import androidx.preference.PreferenceScreen
import eu.kanade.tachiyomi.AppInfo
import eu.kanade.tachiyomi.lib.randomua.addRandomUAPreferenceToScreen
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.POST
import eu.kanade.tachiyomi.source.ConfigurableSource
@ -281,7 +282,7 @@ class DoujinDesu : ParsedHttpSource(), ConfigurableSource {
}
private fun getNumberFromString(epsStr: String?): Float {
return epsStr?.filter { it.isDigit() }?.toFloatOrNull() ?: -1f
return epsStr?.substringBefore(" ")?.toFloatOrNull() ?: -1f
}
private fun reconstructDate(dateStr: String): Long {
@ -398,9 +399,10 @@ class DoujinDesu : ParsedHttpSource(), ConfigurableSource {
override fun chapterFromElement(element: Element): SChapter {
val chapter = SChapter.create()
chapter.chapter_number = getNumberFromString(element.selectFirst("div.epsright chapter")?.text())
val eps = element.selectFirst("div.epsright chapter")?.text()
chapter.chapter_number = getNumberFromString(eps)
chapter.date_upload = reconstructDate(element.select("div.epsleft > span.date").text())
chapter.name = element.select("div.epsleft span.lchx a").text()
chapter.name = "Chapter $eps"
chapter.setUrlWithoutDomain(element.select("div.epsleft > span.lchx > a").attr("href"))
return chapter
@ -409,6 +411,7 @@ class DoujinDesu : ParsedHttpSource(), ConfigurableSource {
override fun headersBuilder(): Headers.Builder =
super.headersBuilder()
.add("Referer", "$baseUrl/")
.add("X-Requested-With", "XMLHttpRequest")
override fun imageRequest(page: Page): Request {
val newHeaders = headersBuilder()
@ -457,5 +460,6 @@ class DoujinDesu : ParsedHttpSource(), ConfigurableSource {
true
}
}.also(screen::addPreference)
addRandomUAPreferenceToScreen(screen)
}
}