MangaHub: Tweak rate limiting, fix decimal chapters (#10780)

* Fix chapters with decimals

* Tweak rate limiting to only apply on chapter images

This also fixes slow thumbnails

* up version
This commit is contained in:
Vetle Ledaal 2022-02-10 10:40:20 +00:00 committed by GitHub
parent 6ae831f2c0
commit dc25a04fe0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 28 additions and 26 deletions

View File

@ -1,6 +1,6 @@
package eu.kanade.tachiyomi.extension.en.mangafoxfun
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor
import eu.kanade.tachiyomi.multisrc.mangahub.MangaHub
import okhttp3.OkHttpClient
import java.util.concurrent.TimeUnit
@ -11,7 +11,7 @@ class MangaFoxFun : MangaHub(
"en"
) {
override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS))
.addInterceptor(SpecificHostRateLimitInterceptor(cdnHost, 1, 2))
.build()
override val serverId = "mf01"

View File

@ -1,6 +1,6 @@
package eu.kanade.tachiyomi.extension.en.mangahereonl
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor
import eu.kanade.tachiyomi.multisrc.mangahub.MangaHub
import okhttp3.OkHttpClient
import java.util.concurrent.TimeUnit
@ -11,7 +11,7 @@ class MangaHereOnl : MangaHub(
"en"
) {
override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS))
.addInterceptor(SpecificHostRateLimitInterceptor(cdnHost, 1, 2))
.build()
override val serverId = "mh01"

View File

@ -1,6 +1,6 @@
package eu.kanade.tachiyomi.extension.en.mangahubio
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor
import eu.kanade.tachiyomi.multisrc.mangahub.MangaHub
import okhttp3.OkHttpClient
import java.util.concurrent.TimeUnit
@ -11,7 +11,7 @@ class MangaHubIo : MangaHub(
"en"
) {
override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS))
.addInterceptor(SpecificHostRateLimitInterceptor(cdnHost, 1, 2))
.build()
override val serverId = "m01"

View File

@ -1,6 +1,6 @@
package eu.kanade.tachiyomi.extension.en.mangakakalotfun
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor
import eu.kanade.tachiyomi.multisrc.mangahub.MangaHub
import okhttp3.OkHttpClient
import java.util.concurrent.TimeUnit
@ -11,7 +11,7 @@ class MangakakalotFun : MangaHub(
"en"
) {
override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS))
.addInterceptor(SpecificHostRateLimitInterceptor(cdnHost, 1, 2))
.build()
override val serverId = "mn01"

View File

@ -1,6 +1,6 @@
package eu.kanade.tachiyomi.extension.en.manganel
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor
import eu.kanade.tachiyomi.multisrc.mangahub.MangaHub
import okhttp3.OkHttpClient
import java.util.concurrent.TimeUnit
@ -11,7 +11,7 @@ class MangaNel : MangaHub(
"en"
) {
override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS))
.addInterceptor(SpecificHostRateLimitInterceptor(cdnHost, 1, 2))
.build()
override val serverId = "mn05"

View File

@ -1,6 +1,6 @@
package eu.kanade.tachiyomi.extension.en.mangaonlinefun
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor
import eu.kanade.tachiyomi.multisrc.mangahub.MangaHub
import okhttp3.OkHttpClient
import java.util.concurrent.TimeUnit
@ -11,7 +11,7 @@ class MangaOnlineFun : MangaHub(
"en"
) {
override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS))
.addInterceptor(SpecificHostRateLimitInterceptor(cdnHost, 1, 2))
.build()
override val serverId = "m02"

View File

@ -1,6 +1,6 @@
package eu.kanade.tachiyomi.extension.en.mangapandaonl
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor
import eu.kanade.tachiyomi.multisrc.mangahub.MangaHub
import okhttp3.OkHttpClient
import java.util.concurrent.TimeUnit
@ -11,7 +11,7 @@ class MangaPandaOnl : MangaHub(
"en"
) {
override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS))
.addInterceptor(SpecificHostRateLimitInterceptor(cdnHost, 1, 2))
.build()
override val serverId = "mr02"

View File

@ -1,6 +1,6 @@
package eu.kanade.tachiyomi.extension.en.mangareadersite
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor
import eu.kanade.tachiyomi.multisrc.mangahub.MangaHub
import okhttp3.OkHttpClient
import java.util.concurrent.TimeUnit
@ -11,7 +11,7 @@ class MangaReaderSite : MangaHub(
"en"
) {
override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS))
.addInterceptor(SpecificHostRateLimitInterceptor(cdnHost, 1, 2))
.build()
override val serverId = "mr01"

View File

@ -1,6 +1,6 @@
package eu.kanade.tachiyomi.extension.en.mangatoday
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor
import eu.kanade.tachiyomi.multisrc.mangahub.MangaHub
import okhttp3.OkHttpClient
import java.util.concurrent.TimeUnit
@ -11,7 +11,7 @@ class MangaToday : MangaHub(
"en"
) {
override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS))
.addInterceptor(SpecificHostRateLimitInterceptor(cdnHost, 1, 2))
.build()
override val serverId = "m03"

View File

@ -1,6 +1,6 @@
package eu.kanade.tachiyomi.extension.en.mangatownhub
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor
import eu.kanade.tachiyomi.multisrc.mangahub.MangaHub
import okhttp3.OkHttpClient
import java.util.concurrent.TimeUnit
@ -11,7 +11,7 @@ class MangaTownHub : MangaHub(
"en"
) {
override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS))
.addInterceptor(SpecificHostRateLimitInterceptor(cdnHost, 1, 2))
.build()
override val serverId = "mt01"

View File

@ -1,6 +1,6 @@
package eu.kanade.tachiyomi.extension.en.onemangaco
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor
import eu.kanade.tachiyomi.multisrc.mangahub.MangaHub
import okhttp3.OkHttpClient
import java.util.concurrent.TimeUnit
@ -11,7 +11,7 @@ class OneMangaCo : MangaHub(
"en"
) {
override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS))
.addInterceptor(SpecificHostRateLimitInterceptor(cdnHost, 1, 2))
.build()
override val serverId = "mn03"

View File

@ -1,6 +1,6 @@
package eu.kanade.tachiyomi.extension.en.onemangainfo
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor
import eu.kanade.tachiyomi.multisrc.mangahub.MangaHub
import okhttp3.OkHttpClient
import java.util.concurrent.TimeUnit
@ -11,7 +11,7 @@ class OneMangaInfo : MangaHub(
"en"
) {
override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS))
.addInterceptor(SpecificHostRateLimitInterceptor(cdnHost, 1, 2))
.build()
override val serverId = "mn02"

View File

@ -41,6 +41,8 @@ abstract class MangaHub(
protected abstract val serverId: String
protected open val cdnHost = " https://img.mghubcdn.com/".toHttpUrl()
// Popular
override fun popularMangaRequest(page: Int): Request =
GET("$baseUrl/popular/page/$page", headers)
@ -367,7 +369,7 @@ data class ChapterInnerDto(
val manga: MangaInnerDto,
@SerialName("mangaID") val mangaId: Int,
val noAd: Boolean,
val number: Int,
val number: Float,
val pages: String,
val slug: String,
val title: String

View File

@ -9,7 +9,7 @@ class MangaHubGenerator : ThemeSourceGenerator {
override val themeClass = "MangaHub"
override val baseVersionCode: Int = 1
override val baseVersionCode: Int = 2
override val sources = listOf(
SingleLang("1Manga.co", "https://1manga.co", "en", isNsfw = true, className = "OneMangaCo"),