@ -17,9 +17,21 @@ import javax.script.SimpleBindings
@Suppress("unused")
interface BaseSource : JsExtensions {
var loginUrl: String?
var header: String?
fun getStoreUrl(): String
fun getLoginJs(): String? {
val loginJs = loginUrl
return when {
loginJs == null -> null
loginJs.startsWith("@js:") -> loginJs.substring(4)
loginJs.startsWith("<js>") ->
loginJs.substring(4, loginJs.lastIndexOf("<"))
else -> loginJs
}
/**
* 解析header规则
@ -28,7 +28,7 @@ data class BookSource(
var enabled: Boolean = true, // 是否启用
var enabledExplore: Boolean = true, // 启用发现
override var header: String? = null, // 请求头
var loginUrl: String? = null, // 登录地址
override var loginUrl: String? = null, // 登录地址
var loginUi: List<RowUi>? = null, //登录UI
var loginCheckJs: String? = null, //登录检测js
var bookSourceComment: String? = null, // 注释
@ -21,7 +21,7 @@ data class RssSource(
var sourceComment: String? = null,
var enabled: Boolean = true,
var sortUrl: String? = null,