fix earlymanga chapter list (#5921)
This commit is contained in:
parent
0abfb4f701
commit
d25127f865
|
@ -5,12 +5,8 @@ ext {
|
||||||
extName = 'EarlyManga'
|
extName = 'EarlyManga'
|
||||||
pkgNameSuffix = 'en.earlymanga'
|
pkgNameSuffix = 'en.earlymanga'
|
||||||
extClass = '.EarlyManga'
|
extClass = '.EarlyManga'
|
||||||
extVersionCode = 11
|
extVersionCode = 12
|
||||||
libVersion = '1.2'
|
libVersion = '1.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implementation project(':lib-ratelimit')
|
|
||||||
}
|
|
||||||
|
|
||||||
apply from: "$rootDir/common.gradle"
|
apply from: "$rootDir/common.gradle"
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package eu.kanade.tachiyomi.extension.en.earlymanga
|
package eu.kanade.tachiyomi.extension.en.earlymanga
|
||||||
|
|
||||||
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
|
|
||||||
import eu.kanade.tachiyomi.network.GET
|
import eu.kanade.tachiyomi.network.GET
|
||||||
import eu.kanade.tachiyomi.source.model.FilterList
|
import eu.kanade.tachiyomi.source.model.FilterList
|
||||||
import eu.kanade.tachiyomi.source.model.Page
|
import eu.kanade.tachiyomi.source.model.Page
|
||||||
|
@ -16,7 +15,6 @@ import org.jsoup.nodes.Document
|
||||||
import org.jsoup.nodes.Element
|
import org.jsoup.nodes.Element
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
import java.util.concurrent.TimeUnit
|
|
||||||
|
|
||||||
class EarlyManga : ParsedHttpSource() {
|
class EarlyManga : ParsedHttpSource() {
|
||||||
|
|
||||||
|
@ -28,13 +26,7 @@ class EarlyManga : ParsedHttpSource() {
|
||||||
|
|
||||||
override val supportsLatest = true
|
override val supportsLatest = true
|
||||||
|
|
||||||
private val rateLimitInterceptor = RateLimitInterceptor(1) // 1 request per second
|
override val client: OkHttpClient = network.cloudflareClient
|
||||||
|
|
||||||
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
|
|
||||||
.connectTimeout(10, TimeUnit.SECONDS)
|
|
||||||
.readTimeout(30, TimeUnit.SECONDS)
|
|
||||||
.addNetworkInterceptor(rateLimitInterceptor)
|
|
||||||
.build()
|
|
||||||
|
|
||||||
override fun headersBuilder(): Headers.Builder = Headers.Builder()
|
override fun headersBuilder(): Headers.Builder = Headers.Builder()
|
||||||
.add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.151 Safari/537.36")
|
.add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.151 Safari/537.36")
|
||||||
|
@ -88,7 +80,7 @@ class EarlyManga : ParsedHttpSource() {
|
||||||
author = document.select(".author-link a").text()
|
author = document.select(".author-link a").text()
|
||||||
artist = document.select(".artist-link a").text()
|
artist = document.select(".artist-link a").text()
|
||||||
status = parseStatus(document.select(".pub_stutus").text())
|
status = parseStatus(document.select(".pub_stutus").text())
|
||||||
description = document.select(".desc").text()
|
description = document.select(".desc").text().substringAfterLast("____")
|
||||||
genre = document.select(".manga-info-card a.badge-secondary").joinToString { it.text() }
|
genre = document.select(".manga-info-card a.badge-secondary").joinToString { it.text() }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,8 +118,8 @@ class EarlyManga : ParsedHttpSource() {
|
||||||
override fun chapterListSelector() = ".chapter-container > .row:not(:first-child)"
|
override fun chapterListSelector() = ".chapter-container > .row:not(:first-child)"
|
||||||
|
|
||||||
override fun chapterFromElement(element: Element) = SChapter.create().apply {
|
override fun chapterFromElement(element: Element) = SChapter.create().apply {
|
||||||
setUrlWithoutDomain(element.select(".col>.row>.col-lg-5:not([style*=display:]):not([class*=none]) a[href*=chapter]:not([style*=display:])").attr("href"))
|
setUrlWithoutDomain(element.select(".col>.row>.col-lg-5:not([style*=display:]):not(:has(a[href*=EarlyManga])) a[href*=chapter]:not([style*=display:])").attr("href"))
|
||||||
name = element.select(".col>.row>.col-lg-5:not([style*=display:]):not([class*=none]) a[href*=chapter]:not([style*=display:])").attr("href").substringAfter("chapter")
|
name = element.select(".col>.row>.col-lg-5:not([style*=display:]):not(:has(a[href*=EarlyManga])) a[href*=chapter]:not([style*=display:])").attr("href").substringAfter("chapter")
|
||||||
name = "Chapter" + name
|
name = "Chapter" + name
|
||||||
date_upload = parseChapterDate(element.select(".ml-1").attr("title"))
|
date_upload = parseChapterDate(element.select(".ml-1").attr("title"))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue