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:
parent
6ae831f2c0
commit
dc25a04fe0
|
@ -1,6 +1,6 @@
|
||||||
package eu.kanade.tachiyomi.extension.en.mangafoxfun
|
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 eu.kanade.tachiyomi.multisrc.mangahub.MangaHub
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
|
@ -11,7 +11,7 @@ class MangaFoxFun : MangaHub(
|
||||||
"en"
|
"en"
|
||||||
) {
|
) {
|
||||||
override val client: OkHttpClient = super.client.newBuilder()
|
override val client: OkHttpClient = super.client.newBuilder()
|
||||||
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS))
|
.addInterceptor(SpecificHostRateLimitInterceptor(cdnHost, 1, 2))
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
override val serverId = "mf01"
|
override val serverId = "mf01"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package eu.kanade.tachiyomi.extension.en.mangahereonl
|
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 eu.kanade.tachiyomi.multisrc.mangahub.MangaHub
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
|
@ -11,7 +11,7 @@ class MangaHereOnl : MangaHub(
|
||||||
"en"
|
"en"
|
||||||
) {
|
) {
|
||||||
override val client: OkHttpClient = super.client.newBuilder()
|
override val client: OkHttpClient = super.client.newBuilder()
|
||||||
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS))
|
.addInterceptor(SpecificHostRateLimitInterceptor(cdnHost, 1, 2))
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
override val serverId = "mh01"
|
override val serverId = "mh01"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package eu.kanade.tachiyomi.extension.en.mangahubio
|
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 eu.kanade.tachiyomi.multisrc.mangahub.MangaHub
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
|
@ -11,7 +11,7 @@ class MangaHubIo : MangaHub(
|
||||||
"en"
|
"en"
|
||||||
) {
|
) {
|
||||||
override val client: OkHttpClient = super.client.newBuilder()
|
override val client: OkHttpClient = super.client.newBuilder()
|
||||||
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS))
|
.addInterceptor(SpecificHostRateLimitInterceptor(cdnHost, 1, 2))
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
override val serverId = "m01"
|
override val serverId = "m01"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package eu.kanade.tachiyomi.extension.en.mangakakalotfun
|
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 eu.kanade.tachiyomi.multisrc.mangahub.MangaHub
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
|
@ -11,7 +11,7 @@ class MangakakalotFun : MangaHub(
|
||||||
"en"
|
"en"
|
||||||
) {
|
) {
|
||||||
override val client: OkHttpClient = super.client.newBuilder()
|
override val client: OkHttpClient = super.client.newBuilder()
|
||||||
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS))
|
.addInterceptor(SpecificHostRateLimitInterceptor(cdnHost, 1, 2))
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
override val serverId = "mn01"
|
override val serverId = "mn01"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package eu.kanade.tachiyomi.extension.en.manganel
|
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 eu.kanade.tachiyomi.multisrc.mangahub.MangaHub
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
|
@ -11,7 +11,7 @@ class MangaNel : MangaHub(
|
||||||
"en"
|
"en"
|
||||||
) {
|
) {
|
||||||
override val client: OkHttpClient = super.client.newBuilder()
|
override val client: OkHttpClient = super.client.newBuilder()
|
||||||
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS))
|
.addInterceptor(SpecificHostRateLimitInterceptor(cdnHost, 1, 2))
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
override val serverId = "mn05"
|
override val serverId = "mn05"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package eu.kanade.tachiyomi.extension.en.mangaonlinefun
|
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 eu.kanade.tachiyomi.multisrc.mangahub.MangaHub
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
|
@ -11,7 +11,7 @@ class MangaOnlineFun : MangaHub(
|
||||||
"en"
|
"en"
|
||||||
) {
|
) {
|
||||||
override val client: OkHttpClient = super.client.newBuilder()
|
override val client: OkHttpClient = super.client.newBuilder()
|
||||||
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS))
|
.addInterceptor(SpecificHostRateLimitInterceptor(cdnHost, 1, 2))
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
override val serverId = "m02"
|
override val serverId = "m02"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package eu.kanade.tachiyomi.extension.en.mangapandaonl
|
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 eu.kanade.tachiyomi.multisrc.mangahub.MangaHub
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
|
@ -11,7 +11,7 @@ class MangaPandaOnl : MangaHub(
|
||||||
"en"
|
"en"
|
||||||
) {
|
) {
|
||||||
override val client: OkHttpClient = super.client.newBuilder()
|
override val client: OkHttpClient = super.client.newBuilder()
|
||||||
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS))
|
.addInterceptor(SpecificHostRateLimitInterceptor(cdnHost, 1, 2))
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
override val serverId = "mr02"
|
override val serverId = "mr02"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package eu.kanade.tachiyomi.extension.en.mangareadersite
|
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 eu.kanade.tachiyomi.multisrc.mangahub.MangaHub
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
|
@ -11,7 +11,7 @@ class MangaReaderSite : MangaHub(
|
||||||
"en"
|
"en"
|
||||||
) {
|
) {
|
||||||
override val client: OkHttpClient = super.client.newBuilder()
|
override val client: OkHttpClient = super.client.newBuilder()
|
||||||
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS))
|
.addInterceptor(SpecificHostRateLimitInterceptor(cdnHost, 1, 2))
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
override val serverId = "mr01"
|
override val serverId = "mr01"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package eu.kanade.tachiyomi.extension.en.mangatoday
|
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 eu.kanade.tachiyomi.multisrc.mangahub.MangaHub
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
|
@ -11,7 +11,7 @@ class MangaToday : MangaHub(
|
||||||
"en"
|
"en"
|
||||||
) {
|
) {
|
||||||
override val client: OkHttpClient = super.client.newBuilder()
|
override val client: OkHttpClient = super.client.newBuilder()
|
||||||
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS))
|
.addInterceptor(SpecificHostRateLimitInterceptor(cdnHost, 1, 2))
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
override val serverId = "m03"
|
override val serverId = "m03"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package eu.kanade.tachiyomi.extension.en.mangatownhub
|
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 eu.kanade.tachiyomi.multisrc.mangahub.MangaHub
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
|
@ -11,7 +11,7 @@ class MangaTownHub : MangaHub(
|
||||||
"en"
|
"en"
|
||||||
) {
|
) {
|
||||||
override val client: OkHttpClient = super.client.newBuilder()
|
override val client: OkHttpClient = super.client.newBuilder()
|
||||||
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS))
|
.addInterceptor(SpecificHostRateLimitInterceptor(cdnHost, 1, 2))
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
override val serverId = "mt01"
|
override val serverId = "mt01"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package eu.kanade.tachiyomi.extension.en.onemangaco
|
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 eu.kanade.tachiyomi.multisrc.mangahub.MangaHub
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
|
@ -11,7 +11,7 @@ class OneMangaCo : MangaHub(
|
||||||
"en"
|
"en"
|
||||||
) {
|
) {
|
||||||
override val client: OkHttpClient = super.client.newBuilder()
|
override val client: OkHttpClient = super.client.newBuilder()
|
||||||
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS))
|
.addInterceptor(SpecificHostRateLimitInterceptor(cdnHost, 1, 2))
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
override val serverId = "mn03"
|
override val serverId = "mn03"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package eu.kanade.tachiyomi.extension.en.onemangainfo
|
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 eu.kanade.tachiyomi.multisrc.mangahub.MangaHub
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
|
@ -11,7 +11,7 @@ class OneMangaInfo : MangaHub(
|
||||||
"en"
|
"en"
|
||||||
) {
|
) {
|
||||||
override val client: OkHttpClient = super.client.newBuilder()
|
override val client: OkHttpClient = super.client.newBuilder()
|
||||||
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS))
|
.addInterceptor(SpecificHostRateLimitInterceptor(cdnHost, 1, 2))
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
override val serverId = "mn02"
|
override val serverId = "mn02"
|
||||||
|
|
|
@ -41,6 +41,8 @@ abstract class MangaHub(
|
||||||
|
|
||||||
protected abstract val serverId: String
|
protected abstract val serverId: String
|
||||||
|
|
||||||
|
protected open val cdnHost = " https://img.mghubcdn.com/".toHttpUrl()
|
||||||
|
|
||||||
// Popular
|
// Popular
|
||||||
override fun popularMangaRequest(page: Int): Request =
|
override fun popularMangaRequest(page: Int): Request =
|
||||||
GET("$baseUrl/popular/page/$page", headers)
|
GET("$baseUrl/popular/page/$page", headers)
|
||||||
|
@ -367,7 +369,7 @@ data class ChapterInnerDto(
|
||||||
val manga: MangaInnerDto,
|
val manga: MangaInnerDto,
|
||||||
@SerialName("mangaID") val mangaId: Int,
|
@SerialName("mangaID") val mangaId: Int,
|
||||||
val noAd: Boolean,
|
val noAd: Boolean,
|
||||||
val number: Int,
|
val number: Float,
|
||||||
val pages: String,
|
val pages: String,
|
||||||
val slug: String,
|
val slug: String,
|
||||||
val title: String
|
val title: String
|
||||||
|
|
|
@ -9,7 +9,7 @@ class MangaHubGenerator : ThemeSourceGenerator {
|
||||||
|
|
||||||
override val themeClass = "MangaHub"
|
override val themeClass = "MangaHub"
|
||||||
|
|
||||||
override val baseVersionCode: Int = 1
|
override val baseVersionCode: Int = 2
|
||||||
|
|
||||||
override val sources = listOf(
|
override val sources = listOf(
|
||||||
SingleLang("1Manga.co", "https://1manga.co", "en", isNsfw = true, className = "OneMangaCo"),
|
SingleLang("1Manga.co", "https://1manga.co", "en", isNsfw = true, className = "OneMangaCo"),
|
||||||
|
|
Loading…
Reference in New Issue