Files
mpv-config/scripts/uosc_danmaku/modules/options.lua
T
2026-04-03 11:33:51 +02:00

77 lines
3.2 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
local opt = require("mp.options")
-- 选项
options = {
-- 指定弹幕服务器地址,自定义服务需兼容 dandanplay 的 api
api_server = "https://api.dandanplay.net",
-- 指定 b 站和爱腾优的弹幕获取的兜底服务器地址,主要用于获取非动画弹幕
-- 可用: https://api.danmu.icuhttps://dmku.hls.one
fallback_server = "https://api.danmu.icu",
-- 设置 tmdb 的 API Key用于获取非动画条目的中文信息(当搜索内容非中文时)
-- 可以在 https://www.themoviedb.org 注册后去个人账号设置界面获取
-- 注意:自定义此参数时还需要对获取到的 API Key 进行 base64 编码
tmdb_api_key = "NmJmYjIxOTZkNzIyN2UyMTIzMGM3Y2YzZjQ4MDNkZGM=",
auto_load = false,
autoload_local_danmaku = false,
autoload_for_url = false,
save_danmaku = false,
user_agent = "mpv_danmaku/1.0",
proxy = "",
-- 可选:向 HTTP 请求传递 cookie.txt 文件路径
cookie_file = "",
-- 使用 fps 视频滤镜,大幅提升弹幕平滑度。默认禁用
vf_fps = false,
-- 设置要使用的 fps 滤镜参数
fps = "60/1.001",
-- 指定合并重复弹幕的时间间隔的容差值,单位为秒。默认值: -1表示禁用
merge_tolerance = -1,
-- 指定弹幕关联历史记录文件的路径,支持绝对路径和相对路径
history_path = "~~/danmaku-history.json",
open_search_danmaku_menu_key = "Ctrl+d",
show_danmaku_keyboard_key = "j",
-- 中文简繁转换。0-不转换1-转换为简体2-转换为繁体
chConvert = 0,
--滚动弹幕的显示时间
scrolltime = 15,
--固定弹幕的显示时间
fixtime = 5,
--字体
fontname = "sans-serif",
--字体大小
fontsize = 50,
--字体阴影
shadow = 0,
--字体粗体
bold = true,
-- 透明度0完全透明到 1不透明
opacity = 0.7,
--全部弹幕的显示范围(0.0-1.0)
displayarea = 0.85,
--描边 0-4
outline = 1.0,
-- 限制屏幕中同时显示的最大弹幕数量0 表示不限制
max_screen_danmaku = 0,
--指定弹幕屏蔽词文件路径(black.txt),支持绝对路径和相对路径。文件内容以换行分隔
--支持 lua 的正则表达式写法
blacklist_path = "",
--指定脚本相关消息显示的消息的对齐方式
message_anlignment = 7,
--指定脚本相关消息显示的消息的x轴坐标
message_x = 30,
--指定脚本相关消息显示的消息的y轴坐标
message_y = 30,
-- 自定义标题解析中的额外替换规则,内容格式为 JSON 字符串,替换模式为 lua 的 string.gsub 函数
--! 注意:由于 mpv 的 lua 版本限制,自定义规则只支持形如 %n 的捕获组写法,即示例用法,不支持直接替换字符的写法
title_replace = [[
[{
"rules": [{ "^(.-)": "%1"},{ "^.*《(.-)》": "%1" }],
}]
]],
-- 指定哈希匹配中需忽略的共享盘(挂载盘)的路径/目录。支持绝对路径和相对路径,多个路径用逗号分隔
-- 示例:["X:", "Z:", "F:/Download/", "Download"]
excluded_path = [[
[]
]],
}
opt.read_options(options, mp.get_script_name(), function() end)