xyz.cssxsh.arknights.bilibili.Video.kt Maven / Gradle / Ivy
package xyz.cssxsh.arknights.bilibili
import kotlinx.serialization.*
import xyz.cssxsh.arknights.*
import java.time.*
internal const val BILIBILI_API = "https://api.bilibili.com/x/space/arc/search"
internal const val BILIBILI_ID = 161775300L
@Serializable
public enum class VideoType(public val tid: Int, public vararg val sub: Int) : CacheKey {
ANIME(1, 27),
MUSIC(3, 28, 29, 130, 193),
GAME(4, 172),
ENTERTAINMENT(5, 71);
override val filename: String = "BILIBILI.${name}.json"
override val url: String get() = BILIBILI_API
}
@Serializable
internal data class Temp(
@SerialName("code")
val code: Int,
@SerialName("data")
val `data`: VideoHistory? = null,
@SerialName("message")
val message: String,
@SerialName("ttl")
val ttl: Int = 0
)
@Serializable
internal data class VideoHistory(
@SerialName("list")
val list: VideoList = VideoList(emptyList()),
@SerialName("page")
val page: VideoPage? = null
)
@Serializable
internal data class VideoList(
@SerialName("vlist")
val videos: List