Fix cloudflare un-caught causes app crashing (#1178)

Fix cloudflare uncatch causes app crashing
This commit is contained in:
Cuong M. Tran 2024-02-11 01:08:22 +07:00 committed by Draff
parent bc4df5d008
commit 731145443b
4 changed files with 29 additions and 25 deletions

View File

@ -1,7 +1,7 @@
ext {
extName = 'Hentai Cosplay'
extClass = '.HentaiCosplay'
extVersionCode = 2
extVersionCode = 3
isNsfw = true
}

View File

@ -138,6 +138,7 @@ class HentaiCosplay : HttpSource() {
private fun fetchTags() {
Single.fromCallable {
runCatching {
client.newCall(GET("$baseUrl/ranking-tag/", headers))
.execute().asJsoup()
.run {
@ -154,6 +155,7 @@ class HentaiCosplay : HttpSource() {
}
}
}
}
.subscribeOn(Schedulers.io())
.observeOn(Schedulers.io())
.subscribe()

View File

@ -1,7 +1,7 @@
ext {
extName = 'TruyenGiHot'
extClass = '.TruyenGiHot'
extVersionCode = 4
extVersionCode = 5
isNsfw = true
}

View File

@ -285,6 +285,7 @@ class TruyenGiHot : ParsedHttpSource() {
}
Single.fromCallable {
runCatching {
val document = client.newCall(GET("$baseUrl/danh-sach-truyen.html", headers)).execute().asJsoup()
val result = runCatching {
@ -299,6 +300,7 @@ class TruyenGiHot : ParsedHttpSource() {
fetchFiltersFailed = result.isFailure
fetchFiltersAttempts++
}
}
.subscribeOn(Schedulers.io())
.observeOn(Schedulers.io())
.subscribe()