TruyenGG, TruyenQQ: Fix http 429 manga update (#6354)
* Fix http 429 manga update error TruyenGG * Fix http 429 manga update error TruyenQQ * Update TruyenQQ.kt * Update TruyenQQ.kt
This commit is contained in:
parent
050efe196b
commit
91b673efbb
|
@ -1,7 +1,7 @@
|
|||
ext {
|
||||
extName = 'TruyenGG'
|
||||
extClass = '.TruyenGG'
|
||||
extVersionCode = 2
|
||||
extVersionCode = 3
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
|
|
@ -25,6 +25,7 @@ import uy.kohesive.injekt.Injekt
|
|||
import uy.kohesive.injekt.api.get
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
class TruyenGG : ParsedHttpSource(), ConfigurableSource {
|
||||
|
||||
|
@ -39,7 +40,7 @@ class TruyenGG : ParsedHttpSource(), ConfigurableSource {
|
|||
override val baseUrl by lazy { getPrefBaseUrl() }
|
||||
|
||||
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
|
||||
.rateLimit(1)
|
||||
.rateLimit(1, 2, TimeUnit.SECONDS)
|
||||
.build()
|
||||
|
||||
override fun headersBuilder(): Headers.Builder =
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
ext {
|
||||
extName = 'TruyenQQ'
|
||||
extClass = '.TruyenQQ'
|
||||
extVersionCode = 15
|
||||
extVersionCode = 16
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package eu.kanade.tachiyomi.extension.vi.truyenqq
|
||||
|
||||
import eu.kanade.tachiyomi.network.GET
|
||||
import eu.kanade.tachiyomi.network.interceptor.rateLimit
|
||||
import eu.kanade.tachiyomi.source.model.Filter
|
||||
import eu.kanade.tachiyomi.source.model.FilterList
|
||||
import eu.kanade.tachiyomi.source.model.Page
|
||||
|
@ -31,10 +32,7 @@ class TruyenQQ : ParsedHttpSource() {
|
|||
override val supportsLatest: Boolean = true
|
||||
|
||||
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
|
||||
.connectTimeout(30, TimeUnit.SECONDS)
|
||||
.readTimeout(30, TimeUnit.SECONDS)
|
||||
.retryOnConnectionFailure(true)
|
||||
.followRedirects(true)
|
||||
.rateLimit(1, 2, TimeUnit.SECONDS)
|
||||
.build()
|
||||
|
||||
override fun headersBuilder(): Headers.Builder =
|
||||
|
@ -53,7 +51,7 @@ class TruyenQQ : ParsedHttpSource() {
|
|||
val anchor = element.selectFirst(".book_info .qtip a")!!
|
||||
setUrlWithoutDomain(anchor.attr("href"))
|
||||
title = anchor.text()
|
||||
thumbnail_url = element.select(".book_avatar img").attr("abs:src")
|
||||
thumbnail_url = element.selectFirst(".book_avatar img")?.attr("abs:src")
|
||||
}
|
||||
|
||||
// Selector của nút trang kế tiếp
|
||||
|
@ -101,7 +99,7 @@ class TruyenQQ : ParsedHttpSource() {
|
|||
author = info.select(".org").joinToString { it.text() }
|
||||
genre = document.select(".list01 li").joinToString { it.text() }
|
||||
description = document.select(".story-detail-info").textWithLinebreaks()
|
||||
thumbnail_url = document.select("img[itemprop=image]").attr("abs:src")
|
||||
thumbnail_url = document.selectFirst("img[itemprop=image]")?.attr("abs:src")
|
||||
status = when (info.select(".status > p:last-child").text()) {
|
||||
"Đang Cập Nhật" -> SManga.ONGOING
|
||||
"Hoàn Thành" -> SManga.COMPLETED
|
||||
|
@ -119,7 +117,7 @@ class TruyenQQ : ParsedHttpSource() {
|
|||
override fun chapterListSelector(): String = "div.works-chapter-list div.works-chapter-item"
|
||||
|
||||
override fun chapterFromElement(element: Element): SChapter = SChapter.create().apply {
|
||||
setUrlWithoutDomain(element.select("a").attr("href"))
|
||||
setUrlWithoutDomain(element.selectFirst("a")!!.attr("href"))
|
||||
name = element.select("a").text().trim()
|
||||
date_upload = parseDate(element.select(".time-chap").text())
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue