mirror of
https://github.com/keiyoushi/extensions-source.git
synced 2024-11-22 10:22:47 +01:00
LuraToon: bypass chapter link redirect (#3359)
LuraToon: fix chapter links redirect
This commit is contained in:
parent
c47b9d852d
commit
029a53ff90
@ -3,7 +3,7 @@ ext {
|
||||
extClass = '.LuraToon'
|
||||
themePkg = 'peachscan'
|
||||
baseUrl = 'https://luratoons.com'
|
||||
overrideVersionCode = 43
|
||||
overrideVersionCode = 44
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
@ -10,6 +10,8 @@ import eu.kanade.tachiyomi.lib.randomua.setRandomUserAgent
|
||||
import eu.kanade.tachiyomi.multisrc.peachscan.PeachScan
|
||||
import eu.kanade.tachiyomi.network.interceptor.rateLimit
|
||||
import eu.kanade.tachiyomi.source.ConfigurableSource
|
||||
import eu.kanade.tachiyomi.source.model.SChapter
|
||||
import org.jsoup.nodes.Element
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
|
||||
@ -36,4 +38,16 @@ class LuraToon :
|
||||
override fun setupPreferenceScreen(screen: PreferenceScreen) {
|
||||
addRandomUAPreferenceToScreen(screen)
|
||||
}
|
||||
|
||||
override fun chapterFromElement(element: Element): SChapter {
|
||||
val mangaUrl = element.ownerDocument()!!.location()
|
||||
|
||||
return super.chapterFromElement(element).apply {
|
||||
val num = url.removeSuffix("/")
|
||||
.substringAfterLast("/")
|
||||
val chapUrl = mangaUrl.removeSuffix("/") + "/$num/"
|
||||
|
||||
setUrlWithoutDomain(chapUrl)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user