Skip to content

Commit

Permalink
脚本更新
Browse files Browse the repository at this point in the history
  • Loading branch information
dyphire committed Jan 25, 2025
1 parent 9e0e2a2 commit 9ee81cc
Show file tree
Hide file tree
Showing 12 changed files with 1,129 additions and 116 deletions.
5 changes: 3 additions & 2 deletions script-opts/sub_assrt.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# API token, 可以在 https://assrt.net 上注册账号后在个人界面获取
api_token=tNjXZUnOJWcHznHDyalNMYqqP6IdDdpQ
# 是否使用 https
#示例为脚本内预设的 key
#api_token=tNjXZUnOJWcHznHDyalNMYqqP6IdDdpQ
# 是否使用 https,默认 yes
#use_https=no
# 代理设置
#proxy=
51 changes: 30 additions & 21 deletions script-opts/sub_fastwhisper.conf
Original file line number Diff line number Diff line change
@@ -1,31 +1,40 @@
# Path to the faster-whisper executable, you can download it from here:
# https://github.com/Purfview/whisper-standalone-win
# Supports absolute and relative paths
# faster-whisper 可执行文件的路径,支持绝对路径和相对路径
# 可以从此处下载:https://github.com/Purfview/whisper-standalone-win
#fast_whisper_path=faster-whisper
# Model to use, available models are: base, small,medium, large, turbo
# 指定要使用的模型,可用模型有:base, small,medium, large, turbo
#model=large-v3
# Device to use, available devices are: cpu, cuda
# 指定要使用的设备,可用设备有:cpucuda
#device=cuda
# Specify the language of transcription
# Leave it blank and it will be automatically detected
# 指定转录语音的语言,留空将自动检测
#language=ja
# Number of cpu threads to use
# Default value is 0 will auto-detect but max 4 threads
# 指定使用的 CPU 线程数
# 默认值为 0,将自动检测,但最多 4 个线程
#threads=8
# The maximum number of characters in a line before breaking the line
# 换行前一行的最大字符数
max_line_width=100
# Specify output path, supports absolute and relative paths
# Special value: "source" saves the subtitle file to the directory
# where the video file is located
# 指定输出路径,支持绝对路径和相对路径
# 特殊值:"source" 会将字幕文件保存到视频文件所在的目录
output_path=source
# Specify how many subtitles are generated before updating
# to avoid frequent flickering of subtitles
# 指定在更新前生成多少字幕。用于避免字幕频繁闪烁
update_interval=20
# Uses segmentation for speech transcription,
# which significantly improves the speed of subtitle initialization.
# but it will reduce the accuracy and overall speed of subtitle generation,
# which is more suitable for long video scenarios.
# 使用分段法进行语音转录,这会大大提高字幕初始化的速度
# 但会降低字幕生成的准确性和整体速度,这更适用于长视频场景
#! Depends on FFmpeg
use_segment=no
# Segment duration in seconds
segment_duration=10
# 以秒为单位的分段持续时间
segment_duration=10
## GPT API 选项 ###
# 与其他结构与 GPT API 相同的 AI API 兼容
# 推荐使用智谱 GLM 的免费 AI 模型:glm-4-flash
api_url=https://open.bigmodel.cn/api/paas/v4/chat/completions
# api key 需自行在对应 AI 平台的个人账号下申请
api_key=
# 指定要使用的 AI 模型
api_mode=glm-4-flash
api_temperature=0.95
# API 使用的每分钟速率。有关说明请参阅相应的 API 文档
api_rate=15
# 指定 AI 翻译的目标语言
translate=Chinese
# 指定生成的 ass 字幕所使用的字体
font_name=Noto Sans CJK SC
3 changes: 3 additions & 0 deletions script-opts/trakt_scrobble.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
#是否启用 trakt 观看记录功能,默认 yes
enabled=no
#指定 trakt 观看记录文件路径,支持绝对或相对路径,默认为 ~~/trakt_history.json
#可以通过修改文件内容来纠正 trakt 关联错误
history_path=~~/files/trakt_history.json
11 changes: 11 additions & 0 deletions scripts/chapter-make-read.lua
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,17 @@ local function read_chapter_table()
end
l = line
line_pos = line_pos + 1
elseif line:match("^%d+:%d+[,%.]?%d+[,%s].*") ~= nil then
m, s = line:match("^(%d+):(%d+[,%.]?%d+)")
s = s:gsub(',', '.')
t = m * 60 + s
if line:match("^%d+:%d+[,%.]?%d+[,%s].*") ~= nil then
n = line:match("^%d+:%d+[,%.]?%d+[,%s](.*)")
n = n:gsub(":%s%a?%a?:", "")
:gsub("^%s*(.-)%s*$", "%1")
end
l = line
line_pos = line_pos + 1
elseif line:match("^CHAPTER%d+=%d+:%d+:%d+") ~= nil then
h, m, s = line:match("^CHAPTER%d+=(%d+):(%d+):(%d+[,%.]?%d+)")
s = s:gsub(',', '.')
Expand Down
Loading

0 comments on commit 9ee81cc

Please sign in to comment.