feat: add reliable OpenList segment uploads
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
# =========================
|
||||
# 基础配置
|
||||
# =========================
|
||||
# Deprecated compatibility script. Prefer the built-in persistent OpenList upload
|
||||
# queue configured in the Web admin. No endpoint or credentials are stored here.
|
||||
|
||||
OPENLIST_BASE_URL="http://192.168.6.145:5244"
|
||||
OPENLIST_USERNAME="${OPENLIST_USERNAME:-admin}"
|
||||
OPENLIST_PASSWORD="${OPENLIST_PASSWORD:-768788}"
|
||||
OPENLIST_BASE_URL="${OPENLIST_BASE_URL:-}"
|
||||
OPENLIST_USERNAME="${OPENLIST_USERNAME:-}"
|
||||
OPENLIST_PASSWORD="${OPENLIST_PASSWORD:-}"
|
||||
OPENLIST_SOURCE_ROOT="${OPENLIST_SOURCE_ROOT:-}"
|
||||
OPENLIST_DESTINATION_ROOT="${OPENLIST_DESTINATION_ROOT:-}"
|
||||
|
||||
segment_path="$LIVE_RECORDER_SEGMENT_FILE_PATH"
|
||||
danmaku_path="$LIVE_RECORDER_DANMAKU_FILE_PATH"
|
||||
@@ -22,6 +23,16 @@ log() {
|
||||
# 参数检查
|
||||
# =========================
|
||||
|
||||
if [ -z "$OPENLIST_BASE_URL" ] || [ -z "$OPENLIST_USERNAME" ] || [ -z "$OPENLIST_PASSWORD" ]; then
|
||||
echo "错误:请通过环境变量配置 OPENLIST_BASE_URL、OPENLIST_USERNAME 和 OPENLIST_PASSWORD" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$OPENLIST_SOURCE_ROOT" ] || [ -z "$OPENLIST_DESTINATION_ROOT" ]; then
|
||||
echo "错误:请通过环境变量配置 OPENLIST_SOURCE_ROOT 和 OPENLIST_DESTINATION_ROOT" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$segment_path" ]; then
|
||||
log "错误:LIVE_RECORDER_SEGMENT_FILE_PATH 为空"
|
||||
exit 1
|
||||
@@ -65,8 +76,8 @@ log "日期: $record_date"
|
||||
log "视频文件名: $video_filename"
|
||||
log "弹幕文件名: $danmaku_filename"
|
||||
|
||||
remote_dir="/yidongpan/records/$anchor_name/$record_date"
|
||||
src_dir="/local/home/nanxun/live_recorder/records/$platform/$anchor_name/$record_date"
|
||||
remote_dir="${OPENLIST_DESTINATION_ROOT%/}/$platform/$anchor_name/$record_date"
|
||||
src_dir="${OPENLIST_SOURCE_ROOT%/}/$platform/$anchor_name/$record_date"
|
||||
|
||||
log "OpenList 源目录: $src_dir"
|
||||
log "OpenList 目标目录: $remote_dir"
|
||||
|
||||
Reference in New Issue
Block a user