|
|
@ -15,9 +15,10 @@ import kotlinx.coroutines.Dispatchers.IO |
|
|
|
import kotlinx.coroutines.async |
|
|
|
import kotlinx.coroutines.async |
|
|
|
import kotlinx.coroutines.ensureActive |
|
|
|
import kotlinx.coroutines.ensureActive |
|
|
|
import kotlinx.coroutines.withContext |
|
|
|
import kotlinx.coroutines.withContext |
|
|
|
|
|
|
|
|
|
|
|
import splitties.init.appCtx |
|
|
|
import splitties.init.appCtx |
|
|
|
|
|
|
|
import java.net.URLDecoder |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Suppress("BlockingMethodInNonBlockingContext") |
|
|
|
object BookChapterList { |
|
|
|
object BookChapterList { |
|
|
|
|
|
|
|
|
|
|
|
suspend fun analyzeChapterList( |
|
|
|
suspend fun analyzeChapterList( |
|
|
@ -27,7 +28,7 @@ object BookChapterList { |
|
|
|
book: Book, |
|
|
|
book: Book, |
|
|
|
redirectUrl: String |
|
|
|
redirectUrl: String |
|
|
|
): List<BookChapter> { |
|
|
|
): List<BookChapter> { |
|
|
|
val baseUrl = strResponse.url |
|
|
|
val baseUrl = URLDecoder.decode(strResponse.url, "utf-8") |
|
|
|
val body = strResponse.body |
|
|
|
val body = strResponse.body |
|
|
|
body ?: throw Exception( |
|
|
|
body ?: throw Exception( |
|
|
|
appCtx.getString(R.string.error_get_web_content, baseUrl) |
|
|
|
appCtx.getString(R.string.error_get_web_content, baseUrl) |
|
|
|