Update parsers

This commit is contained in:
Koitharu
2024-11-10 18:45:44 +02:00
parent 7c2c037654
commit 30e04eb486
3 changed files with 5 additions and 4 deletions

View File

@@ -31,7 +31,7 @@ dependencies {
testImplementation(kotlin("test"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.9.0")
implementation("com.github.ajalt.clikt:clikt-core:5.0.1")
implementation("com.github.KotatsuApp:kotatsu-parsers:08fe54c36d")
implementation("com.github.KotatsuApp:kotatsu-parsers:f3d14e101c")
implementation("com.squareup.okhttp3:okhttp:4.12.0")
implementation("com.squareup.okio:okio:3.9.0")
implementation("io.webfolder:quickjs:1.1.0")

View File

@@ -15,6 +15,7 @@ import org.koitharu.kotatsu.dl.ui.askSelectBranch
import org.koitharu.kotatsu.dl.util.AppCommand
import org.koitharu.kotatsu.dl.util.ChaptersRange
import org.koitharu.kotatsu.dl.util.colored
import org.koitharu.kotatsu.parsers.model.MangaParserSource
import java.io.File
class Main : AppCommand(name = "kotatsu-dl") {
@@ -68,7 +69,7 @@ class Main : AppCommand(name = "kotatsu-dl") {
print("Resolving link…")
val source = linkResolver.getSource()
val manga = linkResolver.getManga()
if (source == null) {
if (source == null || source == MangaParserSource.DUMMY) {
println()
error("Unsupported manga source")
}
@@ -101,7 +102,7 @@ class Main : AppCommand(name = "kotatsu-dl") {
print("==>".green)
print(' ')
}
ChaptersRange.parse(readLine())
ChaptersRange.parse(readlnOrNull())
} else {
ChaptersRange.all()
}

View File

@@ -24,7 +24,7 @@ fun askSelectBranch(chapters: List<MangaChapter>): List<MangaChapter> {
print("==>".green)
print(' ')
}
val userInput = readLine()?.trim().ifNullOrEmpty { "1" }
val userInput = readlnOrNull()?.trim().ifNullOrEmpty { "1" }
val branch = branches[userInput.toInt() - 1].first
return chapters.filter { chapter -> chapter.branch == branch }
} else {