parent
f584c2d169
commit
c423d85e2e
|
@ -3,8 +3,12 @@ ext {
|
||||||
extClass = '.TheBlank'
|
extClass = '.TheBlank'
|
||||||
themePkg = 'madara'
|
themePkg = 'madara'
|
||||||
baseUrl = 'https://theblank.net'
|
baseUrl = 'https://theblank.net'
|
||||||
overrideVersionCode = 1
|
overrideVersionCode = 2
|
||||||
isNsfw = true
|
isNsfw = true
|
||||||
}
|
}
|
||||||
|
|
||||||
apply from: "$rootDir/common.gradle"
|
apply from: "$rootDir/common.gradle"
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation project(':lib:randomua')
|
||||||
|
}
|
||||||
|
|
|
@ -1,22 +1,43 @@
|
||||||
package eu.kanade.tachiyomi.extension.en.theblank
|
package eu.kanade.tachiyomi.extension.en.theblank
|
||||||
|
|
||||||
|
import android.app.Application
|
||||||
|
import androidx.preference.PreferenceScreen
|
||||||
|
import eu.kanade.tachiyomi.lib.randomua.addRandomUAPreferenceToScreen
|
||||||
|
import eu.kanade.tachiyomi.lib.randomua.getPrefCustomUA
|
||||||
|
import eu.kanade.tachiyomi.lib.randomua.getPrefUAType
|
||||||
|
import eu.kanade.tachiyomi.lib.randomua.setRandomUserAgent
|
||||||
import eu.kanade.tachiyomi.multisrc.madara.Madara
|
import eu.kanade.tachiyomi.multisrc.madara.Madara
|
||||||
import eu.kanade.tachiyomi.network.interceptor.rateLimit
|
import eu.kanade.tachiyomi.network.interceptor.rateLimit
|
||||||
|
import eu.kanade.tachiyomi.source.ConfigurableSource
|
||||||
|
import uy.kohesive.injekt.Injekt
|
||||||
|
import uy.kohesive.injekt.api.get
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
|
|
||||||
class TheBlank : Madara(
|
class TheBlank :
|
||||||
"The Blank Scanlation",
|
Madara(
|
||||||
"https://theblank.net",
|
"The Blank Scanlation",
|
||||||
"en",
|
"https://theblank.net",
|
||||||
dateFormat = SimpleDateFormat("dd/MM/yy", Locale.US),
|
"en",
|
||||||
) {
|
dateFormat = SimpleDateFormat("dd/MM/yy", Locale.US),
|
||||||
|
),
|
||||||
|
ConfigurableSource {
|
||||||
|
|
||||||
|
private val preferences = Injekt.get<Application>().getSharedPreferences("source_$id", 0x0000)
|
||||||
|
|
||||||
override val client = super.client.newBuilder()
|
override val client = super.client.newBuilder()
|
||||||
.rateLimit(1)
|
.rateLimit(1)
|
||||||
|
.setRandomUserAgent(
|
||||||
|
preferences.getPrefUAType(),
|
||||||
|
preferences.getPrefCustomUA(),
|
||||||
|
)
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
override val useNewChapterEndpoint = true
|
override val useNewChapterEndpoint = true
|
||||||
override val useLoadMoreRequest = LoadMoreStrategy.Always
|
override val useLoadMoreRequest = LoadMoreStrategy.Always
|
||||||
override fun chapterListSelector() = "li.wp-manga-chapter:not(.vip-permission)"
|
override fun chapterListSelector() = "li.wp-manga-chapter:not(.vip-permission)"
|
||||||
|
|
||||||
|
override fun setupPreferenceScreen(screen: PreferenceScreen) {
|
||||||
|
addRandomUAPreferenceToScreen(screen)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue