Files
FishServer/record.sh
2026-04-16 14:53:01 +08:00

25 lines
810 B
Bash
Executable File
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.
#!/usr/bin/env bash
# ZED 录制统一入口。
# 用法(在仓库根目录):
# ./record.sh # 本地前台录制Ctrl+C 停止
# ./record.sh --remote # HTTP 请求已运行的 fish_api 启录
# ./record.sh --stop # HTTP 停止录制
# ./record.sh --status # HTTP 查询录制状态
# ./record.sh --segment-sec 300 # 自定义分段时长
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$ROOT/fish_api"
PY="${PYTHON:-python3.8}"
# Translate convenience flags into subcommands
for arg in "$@"; do
case "$arg" in
--stop) shift; exec "$PY" -m app.zed_record_cli stop "$@" ;;
--status) shift; exec "$PY" -m app.zed_record_cli status "$@" ;;
esac
done
exec "$PY" -m app.zed_record_cli start "$@"