Fix cloudflare un-caught causes app crashing (#1178)
Fix cloudflare uncatch causes app crashing
This commit is contained in:
parent
bc4df5d008
commit
731145443b
@ -1,7 +1,7 @@
|
|||||||
ext {
|
ext {
|
||||||
extName = 'Hentai Cosplay'
|
extName = 'Hentai Cosplay'
|
||||||
extClass = '.HentaiCosplay'
|
extClass = '.HentaiCosplay'
|
||||||
extVersionCode = 2
|
extVersionCode = 3
|
||||||
isNsfw = true
|
isNsfw = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,6 +138,7 @@ class HentaiCosplay : HttpSource() {
|
|||||||
|
|
||||||
private fun fetchTags() {
|
private fun fetchTags() {
|
||||||
Single.fromCallable {
|
Single.fromCallable {
|
||||||
|
runCatching {
|
||||||
client.newCall(GET("$baseUrl/ranking-tag/", headers))
|
client.newCall(GET("$baseUrl/ranking-tag/", headers))
|
||||||
.execute().asJsoup()
|
.execute().asJsoup()
|
||||||
.run {
|
.run {
|
||||||
@ -154,6 +155,7 @@ class HentaiCosplay : HttpSource() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(Schedulers.io())
|
.observeOn(Schedulers.io())
|
||||||
.subscribe()
|
.subscribe()
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
ext {
|
ext {
|
||||||
extName = 'TruyenGiHot'
|
extName = 'TruyenGiHot'
|
||||||
extClass = '.TruyenGiHot'
|
extClass = '.TruyenGiHot'
|
||||||
extVersionCode = 4
|
extVersionCode = 5
|
||||||
isNsfw = true
|
isNsfw = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -285,6 +285,7 @@ class TruyenGiHot : ParsedHttpSource() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Single.fromCallable {
|
Single.fromCallable {
|
||||||
|
runCatching {
|
||||||
val document = client.newCall(GET("$baseUrl/danh-sach-truyen.html", headers)).execute().asJsoup()
|
val document = client.newCall(GET("$baseUrl/danh-sach-truyen.html", headers)).execute().asJsoup()
|
||||||
|
|
||||||
val result = runCatching {
|
val result = runCatching {
|
||||||
@ -299,6 +300,7 @@ class TruyenGiHot : ParsedHttpSource() {
|
|||||||
fetchFiltersFailed = result.isFailure
|
fetchFiltersFailed = result.isFailure
|
||||||
fetchFiltersAttempts++
|
fetchFiltersAttempts++
|
||||||
}
|
}
|
||||||
|
}
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(Schedulers.io())
|
.observeOn(Schedulers.io())
|
||||||
.subscribe()
|
.subscribe()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user