Skip to content

Commit d47f08f

Browse files
committed
feat: external
1 parent 1191964 commit d47f08f

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/main/kotlin/xyz/cssxsh/arknights/bilibili/VideoDataHolder.kt

+11-2
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,18 @@ public class VideoDataHolder(override val folder: File, override val ignore: sus
2727

2828
private val AcceptAllCookiesStorage.container: MutableList<Cookie> by reflect()
2929

30+
private val external: File by lazy {
31+
File(
32+
System.getProperty(
33+
"xyz.cssxsh.arknights.bilibili.external",
34+
"data/xyz.cssxsh.mirai.plugin.bilibili-helper"
35+
)
36+
)
37+
}
38+
3039
private val salt: String
3140
get() = kotlin.run {
32-
val file = File("data/xyz.cssxsh.mirai.plugin.bilibili-helper/salt.txt")
41+
val file = external.resolve("salt.txt")
3342
if (file.exists()) {
3443
file.readText()
3544
} else {
@@ -39,7 +48,7 @@ public class VideoDataHolder(override val folder: File, override val ignore: sus
3948

4049
init {
4150
http.launch {
42-
val cookies = with(File("data/xyz.cssxsh.mirai.plugin.bilibili-helper/cookies.json")) {
51+
val cookies = with(external.resolve("cookies.json")) {
4352
if (exists().not()) return@with emptyList()
4453
Json.decodeFromString<List<EditThisCookie>>(readText().ifBlank { "[]" })
4554
.map { it.toCookie() }

0 commit comments

Comments
 (0)