All Downloads are FREE. Search and download functionalities are using the official Maven repository.

xyz.cssxsh.mirai.bilibili.data.BiliSeleniumConfig.kt Maven / Gradle / Ivy

The newest version!
package xyz.cssxsh.mirai.bilibili.data

import net.mamoe.mirai.console.data.*
import xyz.cssxsh.selenium.*

object BiliSeleniumConfig : ReadOnlyPluginConfig("SeleniumConfig") {
    @ValueName("user_agent")
    @ValueDescription("截图UA")
    val userAgent: String by value("Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) Version/11.0 Mobile/15A5341f Safari/604.1 MicroMessenger")

    @ValueName("width")
    @ValueDescription("截图宽度")
    val width: Int by value(768)

    @ValueName("height")
    @ValueDescription("截图高度")
    val height: Int by value(1024)

    @ValueName("headless")
    @ValueDescription("无头模式(后台模式)")
    val headless: Boolean by value(true)

    private val DEFAULT_HIDE_SELECTOR = arrayOf(".open-app", ".launch-app-btn", ".unlogin-popover", ".no-login")

    @ValueName("hide")
    @ValueDescription("隐藏的web组件(jQ选择器)")
    val hide: Array by value(DEFAULT_HIDE_SELECTOR)

    object Agent : RemoteWebDriverConfig by RemoteWebDriverConfig.INSTANCE {
        override val userAgent: String get() = BiliSeleniumConfig.userAgent
        override val width: Int get() = BiliSeleniumConfig.width
        override val height: Int get() = BiliSeleniumConfig.height
        override val headless: Boolean get() = BiliSeleniumConfig.headless
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy