Fix chapters selector when chapter list has volume cover (#1121)

Readmanga: ratelimit and chapters selector
This commit is contained in:
Taumer 2019-05-20 06:05:36 +03:00 committed by Eugene
parent 3da42e91fd
commit 1e97569d5f
4 changed files with 30 additions and 14 deletions

View File

@ -5,8 +5,12 @@ ext {
appName = 'Tachiyomi: Mintmanga'
pkgNameSuffix = 'ru.mintmanga'
extClass = '.Mintmanga'
extVersionCode = 9
extVersionCode = 10
libVersion = '1.2'
}
dependencies {
implementation project(':lib-ratelimit')
}
apply from: "$rootDir/common.gradle"

View File

@ -1,16 +1,14 @@
package eu.kanade.tachiyomi.extension.ru.mintmanga
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.Headers
import okhttp3.HttpUrl
import okhttp3.Request
import okhttp3.Response
import okhttp3.*
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.*
import java.util.regex.Pattern
@ -26,6 +24,11 @@ class Mintmanga : ParsedHttpSource() {
override val supportsLatest = true
private val rateLimitInterceptor = RateLimitInterceptor(2)
override val client: OkHttpClient = network.client.newBuilder()
.addNetworkInterceptor(rateLimitInterceptor).build()
override fun popularMangaRequest(page: Int): Request =
GET("$baseUrl/list?sortType=rate&offset=${70 * (page - 1)}&max=70", headers)
@ -87,6 +90,7 @@ class Mintmanga : ParsedHttpSource() {
val manga = SManga.create()
manga.author = infoElement.select("span.elem_author").first()?.text()
manga.artist = infoElement.select("span.elem_illustrator").first()?.text()
manga.genre = infoElement.select("span.elem_genre").text().replace(" ,", ",")
manga.description = infoElement.select("div.manga-description").text()
manga.status = parseStatus(infoElement.html())
@ -101,7 +105,7 @@ class Mintmanga : ParsedHttpSource() {
else -> SManga.UNKNOWN
}
override fun chapterListSelector() = "div.chapters-link tbody tr"
override fun chapterListSelector() = "div.chapters-link > table > tbody > tr:has(td > a)"
override fun chapterFromElement(element: Element): SChapter {
val urlElement = element.select("a").first()

View File

@ -5,8 +5,12 @@ ext {
appName = 'Tachiyomi: Readmanga'
pkgNameSuffix = 'ru.readmanga'
extClass = '.Readmanga'
extVersionCode = 9
extVersionCode = 10
libVersion = '1.2'
}
dependencies {
implementation project(':lib-ratelimit')
}
apply from: "$rootDir/common.gradle"

View File

@ -1,16 +1,14 @@
package eu.kanade.tachiyomi.extension.ru.readmanga
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import okhttp3.Headers
import okhttp3.HttpUrl
import okhttp3.Request
import okhttp3.Response
import okhttp3.*
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.text.SimpleDateFormat
import java.text.ParseException
import java.text.SimpleDateFormat
import java.util.*
import java.util.regex.Pattern
@ -26,6 +24,11 @@ class Readmanga : ParsedHttpSource() {
override val supportsLatest = true
private val rateLimitInterceptor = RateLimitInterceptor(2)
override val client: OkHttpClient = network.client.newBuilder()
.addNetworkInterceptor(rateLimitInterceptor).build()
override fun popularMangaSelector() = "div.tile"
override fun latestUpdatesSelector() = "div.tile"
@ -87,6 +90,7 @@ class Readmanga : ParsedHttpSource() {
val manga = SManga.create()
manga.author = infoElement.select("span.elem_author").first()?.text()
manga.artist = infoElement.select("span.elem_illustrator").first()?.text()
manga.genre = infoElement.select("span.elem_genre").text().replace(" ,", ",")
manga.description = infoElement.select("div.manga-description").text()
manga.status = parseStatus(infoElement.html())
@ -101,7 +105,7 @@ class Readmanga : ParsedHttpSource() {
else -> SManga.UNKNOWN
}
override fun chapterListSelector() = "div.chapters-link tbody tr"
override fun chapterListSelector() = "div.chapters-link > table > tbody > tr:has(td > a)"
override fun chapterFromElement(element: Element): SChapter {
val urlElement = element.select("a").first()