This commit is contained in:
eric 2026-06-03 18:11:03 -05:00
parent 9068257044
commit 42327263e2
48 changed files with 376 additions and 604 deletions

2
d2ypp2/.gitignore vendored
View File

@ -83,6 +83,8 @@ config/hub_state.sqlite
config/*.sqlite
config/*.sqlite3
config/*.db
config/youtube.*.ini
config/URL_config.*.ini
# Neko / browser runtime data
services/neko/data/

View File

@ -1,2 +0,0 @@
https://live.douyin.com/866853161480,主播: 小小咖啡老吴
https://live.douyin.com/866853161482

View File

@ -1,3 +0,0 @@
https://live.douyin.com/866853161480
https://live.douyin.com/866853161482
https://live.douyin.com/866853161483

View File

@ -1 +0,0 @@
https://live.douyin.com/866853111

View File

@ -1,133 +0,0 @@
[youtube]
key = x04z-564w-aks7-embw-30y4
rtmps = 是
fast_audio = 1
[录制设置]
language(zh_cn/en) = zh_cn
是否跳过代理检测(是/否) = 否
直播保存路径(不填则默认) =
保存文件夹是否以作者区分 = 是
保存文件夹是否以时间区分 = 否
保存文件夹是否以标题区分 = 否
保存文件名是否包含标题 = 否
是否去除名称中的表情符号 = 是
视频保存格式ts|mkv|flv|mp4|mp3音频|m4a音频 = ts
原画|超清|高清|标清|流畅 = 原画
是否使用代理ip(是/否) = 是
代理地址 =
同一时间访问网络的线程数 = 3
循环时间(秒) = 120
排队读取网址时间(秒) = 0
是否显示循环秒数 = 否
是否显示直播源地址 = 否
分段录制是否开启 = 否
是否强制启用https录制 = 否
录制空间剩余阈值(gb) = 1.0
视频分段时间(秒) = 1800
录制完成后自动转为mp4格式 = 否
mp4格式重新编码为h264 = 否
追加格式后删除原文件 = 否
生成时间字幕文件 = 否
是否录制完成后执行自定义脚本 = 否
使用代理录制的平台(逗号分隔) = tiktok, soop, pandalive, winktv, flextv, popkontv, twitch, liveme, showroom, chzzk, shopee, shp, youtu, faceit
额外使用代理录制的平台(逗号分隔) =
[推送配置]
直播状态推送渠道 =
钉钉推送接口链接 =
微信推送接口链接 =
bark推送接口链接 =
bark推送中断级别 = active
bark推送铃声 = bell
钉钉通知@对象(填手机号) =
钉钉通知@全体(是/否) = 否
tgapi令牌 =
tg聊天id(个人或者群组id) =
smtp邮件服务器 =
是否使用smtp服务ssl加密(是/否) = 是
smtp邮件服务器端口 =
邮箱登录账号 =
发件人密码(授权码) =
发件人邮箱 =
发件人显示昵称 =
收件人邮箱 =
ntfy推送地址 =
ntfy推送标签 = tada
ntfy推送邮箱 =
pushplus推送token =
自定义推送标题 = 直播间状态更新通知
自定义开播推送内容 =
自定义关播推送内容 =
只推送通知不录制(是/否) = 否
直播推送检测频率(秒) = 1800
开播推送开启(是/否) = 是
关播推送开启(是/否) = 否
[Cookie]
抖音cookie =
快手cookie =
tiktok_cookie =
虎牙cookie =
斗鱼cookie =
yy_cookie =
b站cookie =
小红书cookie =
bigo_cookie =
blued_cookie =
sooplive_cookie =
netease_cookie =
千度热播_cookie =
pandatv_cookie =
猫耳fm_cookie =
winktv_cookie =
flextv_cookie =
look_cookie =
twitcasting_cookie =
baidu_cookie =
weibo_cookie =
kugou_cookie =
twitch_cookie =
liveme_cookie =
huajiao_cookie =
liuxing_cookie =
showroom_cookie =
acfun_cookie =
changliao_cookie =
yinbo_cookie =
yingke_cookie =
zhihu_cookie =
chzzk_cookie =
haixiu_cookie =
vvxqiu_cookie =
17live_cookie =
langlive_cookie =
pplive_cookie =
6room_cookie =
lehaitv_cookie =
huamao_cookie =
shopee_cookie =
youtube_cookie =
taobao_cookie =
jd_cookie =
faceit_cookie =
migu_cookie =
lianjie_cookie =
laixiu_cookie =
picarto_cookie =
[Authorization]
popkontv_token =
[账号密码]
sooplive账号 =
sooplive密码 =
flextv账号 =
flextv密码 =
popkontv账号 =
partner_code = P-00001
popkontv密码 =
twitcasting账号类型 = normal
twitcasting账号 =
twitcasting密码 =

View File

@ -1,12 +0,0 @@
[youtube]
# YouTube 推流 key(工作室 → 直播 → 串流密钥)
key = x04z-564w-aks7-embw-30y4
# 使用 RTMPS;填 否 则 RTMP
rtmps = 是
# 视频比特率 kbps(可选)
# bitrate = 4000
# 轻量音频链,减轻 CPU:1 / 是
fast_audio = 1

View File

@ -1,12 +0,0 @@
[youtube]
# YouTube 推流 key(工作室 → 直播 → 串流密钥)
key = 23122112
# 使用 RTMPS;填 否 则 RTMP
rtmps = 是
# 视频比特率 kbps(可选)
# bitrate = 4000
# 轻量音频链,减轻 CPU:1 / 是
fast_audio = 0

View File

@ -1,133 +0,0 @@
[youtube]
key = ue78-1c3e-mr9g-14mz-9r4z
rtmps = 是
fast_audio = 1
[录制设置]
language(zh_cn/en) = zh_cn
是否跳过代理检测(是/否) = 否
直播保存路径(不填则默认) =
保存文件夹是否以作者区分 = 是
保存文件夹是否以时间区分 = 否
保存文件夹是否以标题区分 = 否
保存文件名是否包含标题 = 否
是否去除名称中的表情符号 = 是
视频保存格式ts|mkv|flv|mp4|mp3音频|m4a音频 = ts
原画|超清|高清|标清|流畅 = 原画
是否使用代理ip(是/否) = 是
代理地址 =
同一时间访问网络的线程数 = 3
循环时间(秒) = 120
排队读取网址时间(秒) = 0
是否显示循环秒数 = 否
是否显示直播源地址 = 否
分段录制是否开启 = 否
是否强制启用https录制 = 否
录制空间剩余阈值(gb) = 1.0
视频分段时间(秒) = 1800
录制完成后自动转为mp4格式 = 否
mp4格式重新编码为h264 = 否
追加格式后删除原文件 = 否
生成时间字幕文件 = 否
是否录制完成后执行自定义脚本 = 否
使用代理录制的平台(逗号分隔) = tiktok, soop, pandalive, winktv, flextv, popkontv, twitch, liveme, showroom, chzzk, shopee, shp, youtu, faceit
额外使用代理录制的平台(逗号分隔) =
[推送配置]
直播状态推送渠道 =
钉钉推送接口链接 =
微信推送接口链接 =
bark推送接口链接 =
bark推送中断级别 = active
bark推送铃声 = bell
钉钉通知@对象(填手机号) =
钉钉通知@全体(是/否) = 否
tgapi令牌 =
tg聊天id(个人或者群组id) =
smtp邮件服务器 =
是否使用smtp服务ssl加密(是/否) = 是
smtp邮件服务器端口 =
邮箱登录账号 =
发件人密码(授权码) =
发件人邮箱 =
发件人显示昵称 =
收件人邮箱 =
ntfy推送地址 =
ntfy推送标签 = tada
ntfy推送邮箱 =
pushplus推送token =
自定义推送标题 = 直播间状态更新通知
自定义开播推送内容 =
自定义关播推送内容 =
只推送通知不录制(是/否) = 否
直播推送检测频率(秒) = 1800
开播推送开启(是/否) = 是
关播推送开启(是/否) = 否
[Cookie]
抖音cookie =
快手cookie =
tiktok_cookie =
虎牙cookie =
斗鱼cookie =
yy_cookie =
b站cookie =
小红书cookie =
bigo_cookie =
blued_cookie =
sooplive_cookie =
netease_cookie =
千度热播_cookie =
pandatv_cookie =
猫耳fm_cookie =
winktv_cookie =
flextv_cookie =
look_cookie =
twitcasting_cookie =
baidu_cookie =
weibo_cookie =
kugou_cookie =
twitch_cookie =
liveme_cookie =
huajiao_cookie =
liuxing_cookie =
showroom_cookie =
acfun_cookie =
changliao_cookie =
yinbo_cookie =
yingke_cookie =
zhihu_cookie =
chzzk_cookie =
haixiu_cookie =
vvxqiu_cookie =
17live_cookie =
langlive_cookie =
pplive_cookie =
6room_cookie =
lehaitv_cookie =
huamao_cookie =
shopee_cookie =
youtube_cookie =
taobao_cookie =
jd_cookie =
faceit_cookie =
migu_cookie =
lianjie_cookie =
laixiu_cookie =
picarto_cookie =
[Authorization]
popkontv_token =
[账号密码]
sooplive账号 =
sooplive密码 =
flextv账号 =
flextv密码 =
popkontv账号 =
partner_code = P-00001
popkontv密码 =
twitcasting账号类型 = normal
twitcasting账号 =
twitcasting密码 =

View File

@ -14,7 +14,7 @@
## 2026-06-02 生产校验
- wandaA:`wgeasy` 使用 `Endpoint = 129.204.21.129:51820`,`Address = 10.88.0.4/32`,`MTU = 1360`,`PersistentKeepalive = 25`;切回 `107.172.77.34:51820` 时未握手。
- wandaA:`wgeasy` 使用 `Endpoint = 129.204.21.129:51820`,`Address = 10.88.0.4/32`,`MTU = 1360`,`PersistentKeepalive = 25`。
- wandaB:`wgeasy` 使用 `Endpoint = 129.204.21.129:51820`,`Address = 10.88.0.2/32`;到 `10.88.0.1` 的延迟约 25ms。
- Neko 访问优先级:WireGuard `10.88.0.0/24` 优先,frp 公网端口兜底,EasyTier `10.126.126.0/24` 作为备用运维链路。
@ -80,13 +80,3 @@ NEKO_WEBRTC_UDPMUX=52301
- 页面会生成 Windows Endpoint 旁路路由模板。
导入功能只做解析和保存,不直接执行系统级 `wg-quick` 或 Windows 隧道安装命令,避免从 Web 表单执行未审计的网络配置。
## 旧 Endpoint 排障
旧 VPS Endpoint 只保留作排障记录。2026-06-02 校验时,wandaA 指向该端点无法握手,不应作为生产首选:
```ini
Endpoint = 107.172.77.34:51820
```
只有确认旧 VPS 的 wg-easy 容器、UDP `51820` 入站、防火墙和客户端出口都正常后,才临时切换到该端点。同时删除 Windows 上指向腾讯云的持久路由,或改成旧 Endpoint 对应的物理旁路路由。

View File

@ -293,6 +293,9 @@ sync_to_install_dir() {
--exclude '.process_runner/' \
--exclude 'services/neko/data/' \
--exclude 'config/system-stack.env' \
--exclude 'config/hub_state.sqlite' \
--exclude 'config/youtube.*.ini' \
--exclude 'config/URL_config.*.ini' \
"$source_dir/" "$target/"
run_root chown -R live:live "$target" 2>/dev/null || true
printf '%s\n' "$target"

View File

@ -660,6 +660,35 @@ render_neko_compose_file() {
printf '%s' "$out"
}
sync_neko_host_assets() {
local dst="${NEKO_HOST_ASSET_DIR:-}" src item
[ -n "$dst" ] || return 0
case "$dst" in
/|/home/eric/neko|/home/eric/neko-*|/home/eric/neko/*|"$ROOT_DIR"|"$ROOT_DIR"/*)
kv message "Refusing unsafe NEKO_HOST_ASSET_DIR=$dst"
exit 1
;;
esac
src="$ROOT_DIR/services/neko"
mkdir -p "$dst"
for item in external-extensions live-ops-extension no-managed-policies policies provisioning tampermonkey-seed; do
if [ -d "$src/$item" ]; then
mkdir -p "$dst/$item"
if have rsync; then
rsync -a --delete "$src/$item/" "$dst/$item/"
else
cp -a "$src/$item/." "$dst/$item/"
fi
fi
done
for item in browser-launch.sh chromium.conf google-chrome.conf; do
[ -f "$src/$item" ] || continue
install -m 0644 "$src/$item" "$dst/$item"
done
chmod +x "$dst/browser-launch.sh" 2>/dev/null || true
chmod -R a+rX "$dst" 2>/dev/null || true
}
remove_legacy_neko_container() {
if have docker && docker ps -a --format '{{.Names}}' 2>/dev/null | grep -qx 'live-neko-chromium'; then
docker stop live-neko-chromium >/dev/null 2>&1 || true
@ -945,10 +974,19 @@ system_direct_global_ready() {
return 1
}
shellcrash_status_direct_probe() {
if flag_enabled "${SHELLCRASH_STATUS_PROBE_DIRECT:-0}"; then
system_direct_global_ready && printf '%s' ok || printf '%s' fail
else
printf '%s' skipped
fi
}
shellcrash_should_autostart_on_direct_fail() {
flag_enabled "$SHELLCRASH_AUTOSTART_ON_DIRECT_FAIL" || return 1
shellcrash_config_available || return 1
system_direct_global_ready && return 1
shellcrash_config_available
return 0
}
shellcrash_set_systemd_autostart_for_policy() {
@ -1248,7 +1286,7 @@ service_shellcrash_status() {
kv host "${HOSTNAME_ALIAS}.local"
kv port "$(shellcrash_web_port)"
kv autostart "$([ "$enabled" = enabled ] && echo 1 || echo 0)"
kv detail "$detail; direct_google=$(system_direct_global_ready && echo ok || echo fail); config=$(shellcrash_config_available && echo 1 || echo 0); autostart=${enabled:-disabled}"
kv detail "$detail; direct_google=$(shellcrash_status_direct_probe); config=$(shellcrash_config_available && echo 1 || echo 0); autostart=${enabled:-disabled}"
}
service_shellcrash_start() {
@ -1820,6 +1858,7 @@ service_neko_start() {
local instance_count
instance_count="$(resolve_neko_instance_count)"
export_neko_env
sync_neko_host_assets
ensure_neko_browser_launcher_executable
for idx in $(seq 1 "$instance_count"); do
prof="$(resolve_neko_profile_dir_for_instance "$idx")"
@ -1854,6 +1893,7 @@ service_neko_reconfigure() {
local idx instance_count compose_file service_names=""
instance_count="$(resolve_neko_instance_count)"
export_neko_env
sync_neko_host_assets
for idx in $(seq 1 "$instance_count"); do
service_names="${service_names} neko${idx}"
done
@ -1879,6 +1919,7 @@ export_neko_env() {
export NEKO_DISPLAY="${NEKO_DISPLAY:-:99.0}"
export ENV_USER="${ENV_USER:-$NEKO_CONTAINER_USER}"
export ENV_DISPLAY="${ENV_DISPLAY:-$NEKO_DISPLAY}"
export NEKO_HOST_ASSET_DIR="${NEKO_HOST_ASSET_DIR:-}"
export NEKO_PROFILE_HOST_DIR="${NEKO_PROFILE_HOST_DIR:-$(resolve_neko_profile_dir)}"
export NEKO_PROFILE_HOST_DIR_1="${NEKO_PROFILE_HOST_DIR_1:-$(resolve_neko_profile_dir_for_instance 1)}"
export NEKO_PROFILE_HOST_DIR_2="${NEKO_PROFILE_HOST_DIR_2:-$(resolve_neko_profile_dir_for_instance 2)}"

View File

@ -922,7 +922,8 @@ class WebProcessBackend:
if str(name).strip()
}
runtime = set(await self.online_process_names())
return self._pm2_dump_registered_names() | desired | runtime
jlist = set((await self._pm2_jlist_index()).keys())
return self._pm2_dump_registered_names() | desired | runtime | jlist
async def clear_process_logs(self, process: str) -> None:
await self.ensure_mode()
@ -956,24 +957,32 @@ class WebProcessBackend:
if not self._use_pm2:
return {name: self._local.describe_status(name) for name in names}
jlist = await self._pm2_jlist_index()
runtime = await self._proc_runtime_items()
known = self._pm2_dump_registered_names() | {
str(name).strip()
for name in self._read_pm2_desired_state().keys()
if str(name).strip()
}
} | set(jlist) | set(runtime)
out: dict[str, dict[str, Any]] = {}
for name in names:
process_info = runtime.get(name)
out_path, err_path = self._pm2_default_log_paths(name)
item_info = self._pm2_info_from_item(name, jlist.get(name)) if name in jlist else {}
default_out_path, default_err_path = self._pm2_default_log_paths(name)
out_path = item_info.get("out_path") or default_out_path
err_path = item_info.get("err_path") or default_err_path
if process_info is not None:
item_status = str(item_info.get("process_status") or "").strip().lower()
status = item_status if item_status in {"online", "running", "launching"} else "online"
out[name] = {
"process_status": "online",
"process_status": status,
"out_path": out_path,
"err_path": err_path,
"pid": int(process_info.get("pid") or 0),
"pid": int(process_info.get("pid") or item_info.get("pid") or 0),
}
elif item_info:
out[name] = item_info
elif name in known:
out[name] = {
"process_status": "stopped",

View File

@ -11,7 +11,7 @@ _YOUTUBE_HEADER = re.compile(r"^\s*\[youtube\]\s*$", re.IGNORECASE)
_ANY_HEADER = re.compile(r"^\s*\[[^\]]+\]\s*$")
_KEY_LINE = re.compile(r"^\s*(?:key|stream_key)\s*=", re.IGNORECASE)
_YOUTUBE_PRO_PM2_PREFIX = "youtube2__"
_RESERVED_PM2_NAMES = frozenset({"youtube", "douyin_youtube", "tiktok", "obs", "web"})
_RESERVED_PM2_NAMES = frozenset({"douyin_youtube", "tiktok", "obs", "web"})
_DEFAULT_YOUTUBE_TEMPLATE = "[youtube]\nkey = \nrtmps = 是\nfast_audio = 1\n"
_BROKEN_LANE_NAME_RE = re.compile(r"(?:\?|\uff1f){2,}|\ufffd|锟|绾胯矾|çº|è·|Â", re.IGNORECASE)
@ -29,6 +29,8 @@ def normalize_youtube_pro_pm2_name(raw_value: str, channel_id: str) -> str:
raw = sanitize_pm2_segment(raw_value)
if not raw or raw in _RESERVED_PM2_NAMES or raw == _YOUTUBE_PRO_PM2_PREFIX:
return default_youtube_pro_pm2_name(channel_id)
if raw == "youtube":
return raw
if raw.startswith(_YOUTUBE_PRO_PM2_PREFIX):
return raw
return default_youtube_pro_pm2_name(raw)
@ -223,15 +225,15 @@ def ensure_youtube_pro_channel_runtime_files(
pm2 = channel_pm2_name(channel)
youtube_path = config_dir / managed_youtube_ini_relpath_for_pm2(pm2)
url_path = config_dir / managed_url_config_relpath_for_pm2(pm2)
legacy_youtube = config_dir / "youtube.ini"
legacy_url = config_dir / "URL_config.ini"
legacy_youtube = config_dir / "youtube.ini" if pm2 == "youtube" else None
legacy_url = config_dir / "URL_config.ini" if pm2 == "youtube" else None
seed_youtube = (
_read_text_if_file(youtube_path)
or _read_text_if_file(legacy_youtube)
or (legacy_youtube and _read_text_if_file(legacy_youtube))
or _DEFAULT_YOUTUBE_TEMPLATE
)
seed_url = _read_text_if_file(url_path) or _read_text_if_file(legacy_url) or ""
seed_url = _read_text_if_file(url_path) or (legacy_url and _read_text_if_file(legacy_url)) or ""
effective_youtube = seed_youtube
stream_key = str(channel.get("streamKey", "") or "").strip()

View File

@ -57,15 +57,14 @@ class WebDynamicProcessesTests(unittest.TestCase):
self.assertEqual(resolved, "youtube.py")
def test_process_monitor_entries_migrates_legacy_youtube_pm2_without_hiding_single_lane(self) -> None:
def test_process_monitor_entries_allows_first_lane_to_bind_static_youtube(self) -> None:
channels = [{"id": "lane1", "name": "Lane 1", "pm2Name": "youtube"}]
with patch("web.get_youtube_pro_channels", return_value=channels):
entries = web.process_monitor_entries()
youtube_row = next(row for row in entries if row["pm2"] == "youtube")
self.assertEqual(youtube_row["label"], "YouTube")
pro_row = next(row for row in entries if row["pm2"] == "youtube2__lane1")
self.assertEqual(pro_row["label"], "YouTube Pro · Lane 1")
self.assertFalse(any(row["pm2"] == "youtube2__lane1" for row in entries))
def test_process_monitor_entries_do_not_duplicate_static_pm2_rows(self) -> None:
channels = [
@ -76,7 +75,7 @@ class WebDynamicProcessesTests(unittest.TestCase):
entries = web.process_monitor_entries()
self.assertEqual(sum(1 for row in entries if row["pm2"] == "youtube"), 1)
self.assertEqual(sum(1 for row in entries if row["pm2"] == "youtube2__lane1"), 1)
self.assertEqual(sum(1 for row in entries if row["pm2"] == "youtube2__lane1"), 0)
self.assertEqual(sum(1 for row in entries if row["pm2"] == "youtube2__lane2"), 1)
def test_web_module_does_not_repeat_process_entry_function_defs(self) -> None:
@ -197,6 +196,55 @@ class WebDynamicProcessesTests(unittest.TestCase):
self.assertEqual(_json_body(payload)["content"], "https://live.douyin.com/new\n")
self.assertEqual(payload.headers.get("cache-control"), "no-store, max-age=0, must-revalidate")
def test_get_url_config_reads_saved_pro_channel_without_legacy_fallback_or_resync(self) -> None:
with tempfile.TemporaryDirectory() as tmp:
config_dir = Path(tmp)
(config_dir / "URL_config.ini").write_text("https://live.douyin.com/legacy\n", encoding="utf-8")
channels = [
{
"id": "lane1",
"name": "Lane 1",
"pm2Name": "youtube2__lane1",
"urlLines": "https://live.douyin.com/channel\n",
}
]
with patch("web.CONFIG_DIR", config_dir):
with patch("web.allows_url_config", return_value=True):
with patch("web.managed_url_config_relpath", return_value="URL_config.youtube2__lane1.ini"):
with patch("web.get_youtube_pro_channels", return_value=channels):
with patch("web._sync_youtube_pro_runtime_files", side_effect=AssertionError("unexpected resync")):
payload = asyncio.run(web.get_url_config(_ReadRequest(), process="youtube2__lane1"))
managed_exists = (config_dir / "URL_config.youtube2__lane1.ini").exists()
self.assertEqual(_json_body(payload)["content"], "https://live.douyin.com/channel\n")
self.assertFalse(managed_exists)
def test_get_config_reads_saved_pro_channel_key_without_legacy_fallback_or_resync(self) -> None:
with tempfile.TemporaryDirectory() as tmp:
config_dir = Path(tmp)
(config_dir / "youtube.ini").write_text("[youtube]\nkey = legacy-key\n", encoding="utf-8")
channels = [
{
"id": "lane1",
"name": "Lane 1",
"pm2Name": "youtube2__lane1",
"streamKey": "channel-key",
}
]
with patch("web.CONFIG_DIR", config_dir):
with patch("web.managed_youtube_ini_relpath", return_value="youtube.youtube2__lane1.ini"):
with patch("web.get_youtube_pro_channels", return_value=channels):
with patch("web._sync_youtube_pro_runtime_files", side_effect=AssertionError("unexpected resync")):
payload = asyncio.run(web.get_config(_ReadRequest(), process="youtube2__lane1"))
managed_exists = (config_dir / "youtube.youtube2__lane1.ini").exists()
content = _json_body(payload)["content"]
self.assertIn("key = channel-key", content)
self.assertNotIn("legacy-key", content)
self.assertFalse(managed_exists)
def test_save_url_config_updates_matching_youtube_pro_channel_store(self) -> None:
captured: list[list[dict[str, object]]] = []
channels = [{"id": "lane1", "name": "Lane 1", "pm2Name": "youtube2__lane1", "urlLines": "old\n"}]
@ -255,7 +303,7 @@ class WebDynamicProcessesTests(unittest.TestCase):
self.assertEqual(_json_body(payload)["message"], "配置保存成功")
self.assertEqual(captured[-1][0]["streamKey"], "new-key-123")
def test_single_youtube_save_does_not_mutate_legacy_pro_channel_named_youtube(self) -> None:
def test_single_youtube_save_updates_pro_lane_bound_to_youtube(self) -> None:
captured: list[list[dict[str, object]]] = []
channels = [{"id": "lane1", "name": "Lane 1", "pm2Name": "youtube", "urlLines": "old\n"}]
@ -272,7 +320,7 @@ class WebDynamicProcessesTests(unittest.TestCase):
)
self.assertEqual(_json_body(payload)["message"], "配置保存成功")
self.assertEqual(captured, [])
self.assertEqual(captured[-1][0]["urlLines"], "https://live.douyin.com/single\n")
if __name__ == "__main__":

View File

@ -141,6 +141,31 @@ class WebProcessBackendTests(unittest.TestCase):
self.assertEqual(info["err_path"], "/home/live/.pm2/logs/youtube-error.log")
self.assertEqual(info["pid"], 4567)
def test_process_infos_prefers_jlist_log_paths_when_runtime_pid_exists(self) -> None:
with tempfile.TemporaryDirectory() as tmp:
base_dir = Path(tmp)
backend = WebProcessBackend(base_dir, base_dir / ".pm2" / "logs")
backend._use_pm2 = True
item = {
"name": "youtube2__lane1",
"pid": 123,
"pm2_env": {
"status": "online",
"pm_out_log_path": "/etc/.pm2/logs/youtube2--lane1-out.log",
"pm_err_log_path": "/etc/.pm2/logs/youtube2--lane1-error.log",
},
}
with patch.object(backend, "ensure_mode", AsyncMock()):
with patch.object(backend, "_pm2_jlist_index", AsyncMock(return_value={"youtube2__lane1": item})):
with patch.object(backend, "_proc_runtime_items", AsyncMock(return_value={"youtube2__lane1": {"pid": 123}})):
info = asyncio.run(backend.process_infos(["youtube2__lane1"]))["youtube2__lane1"]
self.assertEqual(info["process_status"], "online")
self.assertEqual(info["pid"], 123)
self.assertEqual(info["out_path"], "/etc/.pm2/logs/youtube2--lane1-out.log")
self.assertEqual(info["err_path"], "/etc/.pm2/logs/youtube2--lane1-error.log")
def test_pm2_jlist_items_uses_short_ttl_cache(self) -> None:
with tempfile.TemporaryDirectory() as tmp:
base_dir = Path(tmp)

View File

@ -187,7 +187,7 @@ class WireGuardConfigTests(unittest.TestCase):
"stdout": "\n".join(
[
"wg0\tpriv\tpub\t51820\toff",
f"wg0\tpeer\tpsk\t107.172.77.34:51820\t10.88.0.0/24\t{now - 30}\t4096\t8192\t25",
f"wg0\tpeer\tpsk\t129.204.21.129:51820\t10.88.0.0/24\t{now - 30}\t4096\t8192\t25",
]
),
"stderr": "",

View File

@ -18,7 +18,7 @@ class YoutubeProRuntimeTests(unittest.TestCase):
rows = normalize_youtube_pro_channels([{"id": "lane2", "name": "Lane 2"}])
self.assertEqual(rows[0]["pm2Name"], "youtube2__lane2")
rows = normalize_youtube_pro_channels([{"id": "lane1", "pm2Name": "youtube"}])
self.assertEqual(rows[0]["pm2Name"], "youtube2__lane1")
self.assertEqual(rows[0]["pm2Name"], "youtube")
rows = normalize_youtube_pro_channels([{"id": "lane3", "pm2Name": "custom"}])
self.assertEqual(rows[0]["pm2Name"], "youtube2__custom")
@ -71,11 +71,17 @@ class YoutubeProRuntimeTests(unittest.TestCase):
self.assertIn("key = abcd-efgh-ijkl-mnop", youtube_ini)
self.assertIn("https://live.douyin.com/123456789", url_ini)
def test_materialize_runtime_files_uses_existing_seed_when_channel_fields_blank(self) -> None:
def test_materialize_runtime_files_uses_existing_managed_seed_when_channel_fields_blank(self) -> None:
with tempfile.TemporaryDirectory() as tmp:
config_dir = Path(tmp)
(config_dir / "youtube.ini").write_text("[youtube]\nkey = legacy-key\nrtmps = 是\n", encoding="utf-8")
(config_dir / "URL_config.ini").write_text("https://live.douyin.com/88888888\n", encoding="utf-8")
(config_dir / managed_youtube_ini_relpath_for_pm2("youtube2__lane3")).write_text(
"[youtube]\nkey = managed-key\nrtmps = 是\n",
encoding="utf-8",
)
(config_dir / managed_url_config_relpath_for_pm2("youtube2__lane3")).write_text(
"https://live.douyin.com/88888888\n",
encoding="utf-8",
)
handled, errors = ensure_youtube_pro_channel_runtime_files(
config_dir,
@ -91,6 +97,42 @@ class YoutubeProRuntimeTests(unittest.TestCase):
url_ini = (config_dir / managed_url_config_relpath_for_pm2("youtube2__lane3")).read_text(
encoding="utf-8"
)
self.assertIn("managed-key", youtube_ini)
self.assertIn("https://live.douyin.com/88888888", url_ini)
def test_materialize_runtime_files_ignores_legacy_seed_for_non_single_pro_lane(self) -> None:
with tempfile.TemporaryDirectory() as tmp:
config_dir = Path(tmp)
(config_dir / "youtube.ini").write_text("[youtube]\nkey = legacy-key\nrtmps = 是\n", encoding="utf-8")
(config_dir / "URL_config.ini").write_text("https://live.douyin.com/88888888\n", encoding="utf-8")
handled, errors = ensure_youtube_pro_channel_runtime_files(
config_dir,
"youtube2__lane3",
[{"id": "lane3", "pm2Name": "youtube2__lane3"}],
)
self.assertTrue(handled)
self.assertEqual(errors, ["youtube2__lane3: stream key missing", "youtube2__lane3: source URL missing"])
self.assertFalse((config_dir / managed_youtube_ini_relpath_for_pm2("youtube2__lane3")).exists())
self.assertFalse((config_dir / managed_url_config_relpath_for_pm2("youtube2__lane3")).exists())
def test_materialize_runtime_files_allows_youtube_lane_to_use_single_legacy_seed(self) -> None:
with tempfile.TemporaryDirectory() as tmp:
config_dir = Path(tmp)
(config_dir / "youtube.ini").write_text("[youtube]\nkey = legacy-key\nrtmps = 是\n", encoding="utf-8")
(config_dir / "URL_config.ini").write_text("https://live.douyin.com/88888888\n", encoding="utf-8")
handled, errors = ensure_youtube_pro_channel_runtime_files(
config_dir,
"youtube",
[{"id": "lane1", "pm2Name": "youtube"}],
)
self.assertTrue(handled)
self.assertEqual(errors, [])
youtube_ini = (config_dir / managed_youtube_ini_relpath_for_pm2("youtube")).read_text(encoding="utf-8")
url_ini = (config_dir / managed_url_config_relpath_for_pm2("youtube")).read_text(encoding="utf-8")
self.assertIn("legacy-key", youtube_ini)
self.assertIn("https://live.douyin.com/88888888", url_ini)

View File

@ -164,6 +164,16 @@ FILES = sorted(set(FILES + _discover_repo_files()))
LOG_DIR = REPO_ROOT / ".deploy_logs"
TAIL_LINES = 90
OBSOLETE_SOURCE_RUNTIME_FILES = [
"config/URL_config.youtube.ini",
"config/URL_config.youtube2__ch_mp9mm36r_2wn0r.ini",
"config/URL_config.youtube2__ch_mp9n7yu2_83vci.ini",
"config/youtube.youtube.ini",
"config/youtube.youtube2__ch_mp9mm36r_2wn0r.ini",
"config/youtube.youtube2__ch_mp9mm9lz_a6jfx.ini",
"config/youtube.youtube2__ch_mp9n7yu2_83vci.ini",
]
def _safe_print(text: str) -> None:
try:
@ -462,6 +472,16 @@ def main() -> int:
f"rm -rf {REMOTE_BASE}/src/__pycache__ {REMOTE_BASE}/backup/__pycache__ 2>/dev/null; echo cache_cleared",
timeout=20,
)
obsolete_files = " ".join(
f"{REMOTE_BASE}/{rel}" for rel in OBSOLETE_SOURCE_RUNTIME_FILES
)
run_logged(
client,
log_path,
"remove_obsolete_source_runtime_configs",
f"rm -f {obsolete_files}; echo obsolete_runtime_configs_removed",
timeout=20,
)
run_logged(
client,
log_path,

View File

@ -28,6 +28,13 @@ def instance_value(prefix: str, idx: int, default: str) -> str:
return env(f"{prefix}_{idx}", default)
def host_path(base: str, name: str) -> str:
base = base.strip()
if base in {"", ".", "./"}:
return f"./{name}"
return f"{base.rstrip('/')}/{name}"
def default_udp_range(idx: int) -> str:
if idx == 1:
return "52000-52099"
@ -65,12 +72,22 @@ def render(count: int) -> str:
supervisor_conf = env("NEKO_BROWSER_SUPERVISOR_CONF", "chromium.conf")
tampermonkey_repair = env("NEKO_TAMPERMONKEY_REPAIR", "1")
live_ops_extension = env("NEKO_LIVE_OPS_EXTENSION", "1")
host_asset_dir = env("NEKO_HOST_ASSET_DIR", ".")
base_profile = env("NEKO_PROFILE_HOST_DIR", str(Path.cwd() / "data" / "chromium-profile-v2"))
http_base = int(env("NEKO_HTTP_PORT", "9200"))
mux_base = int(env("NEKO_WEBRTC_TCPMUX", "52300"))
managed_policies = env_enabled("NEKO_MANAGED_POLICIES", True)
external_extensions = env_enabled("NEKO_EXTERNAL_EXTENSIONS", False)
policy_dir = "./policies" if managed_policies else "./no-managed-policies"
policy_dir = env(
"NEKO_POLICY_DIR",
host_path(host_asset_dir, "policies" if managed_policies else "no-managed-policies"),
)
tampermonkey_seed_dir = host_path(host_asset_dir, "tampermonkey-seed")
live_ops_extension_dir = host_path(host_asset_dir, "live-ops-extension")
provisioning_dir = host_path(host_asset_dir, "provisioning")
browser_launch = host_path(host_asset_dir, "browser-launch.sh")
supervisor_conf_host = host_path(host_asset_dir, supervisor_conf)
external_extensions_dir = host_path(host_asset_dir, "external-extensions")
lines = [
"# Generated by tools/render_neko_compose.py - do not hand-edit",
@ -135,18 +152,18 @@ def render(count: int) -> str:
f" - {q(f'{policy_dir}:/etc/chromium/policies/managed:ro')}",
f" - {q(f'{policy_dir}:/etc/chromium-browser/policies/managed:ro')}",
f" - {q(f'{policy_dir}:/etc/opt/chrome/policies/managed:ro')}",
' - "./tampermonkey-seed:/etc/neko/tampermonkey-seed:ro"',
' - "./live-ops-extension:/etc/neko/live-ops-extension:ro"',
' - "./provisioning:/var/www/provisioning:ro"',
' - "./browser-launch.sh:/etc/neko/browser-launch.sh:ro"',
f" - {q(f'./{supervisor_conf}:/etc/neko/supervisord/{supervisor_conf}:ro')}",
f" - {q(f'{tampermonkey_seed_dir}:/etc/neko/tampermonkey-seed:ro')}",
f" - {q(f'{live_ops_extension_dir}:/etc/neko/live-ops-extension:ro')}",
f" - {q(f'{provisioning_dir}:/var/www/provisioning:ro')}",
f" - {q(f'{browser_launch}:/etc/neko/browser-launch.sh:ro')}",
f" - {q(f'{supervisor_conf_host}:/etc/neko/supervisord/{supervisor_conf}:ro')}",
]
)
if external_extensions:
lines[-3:-3] = [
' - "./external-extensions:/opt/google/chrome/extensions:ro"',
' - "./external-extensions:/usr/share/chromium/extensions:ro"',
' - "./external-extensions:/usr/share/chromium-browser/extensions:ro"',
f" - {q(f'{external_extensions_dir}:/opt/google/chrome/extensions:ro')}",
f" - {q(f'{external_extensions_dir}:/usr/share/chromium/extensions:ro')}",
f" - {q(f'{external_extensions_dir}:/usr/share/chromium-browser/extensions:ro')}",
]
return "\n".join(lines) + "\n"

View File

@ -157,7 +157,7 @@ function resolveChannelPm2(channel: YoutubeProChannel): string {
}
const MODE_KEY = "live-hub-youtube-mode-v1";
const PRO_PM2_RESERVED = new Set(["youtube", "douyin_youtube", "tiktok", "obs", "web"]);
const PRO_PM2_RESERVED = new Set(["douyin_youtube", "tiktok", "obs", "web"]);
/** UI 暂时隐藏「多频道 Pro」切换(DOM 与逻辑保留,改 false 即可恢复) */
const HIDE_YOUTUBE_MULTI_PRO_TOGGLE = false;
@ -358,15 +358,6 @@ function businessStatusBadgeClass(row: LiveProcRow | undefined): string {
return "bg-zinc-600/20 text-zinc-400 ring-zinc-500/25";
}
function hasVisibleRuntime(row: LiveProcRow | undefined): boolean {
const business = (row?.business_status || "").trim().toLowerCase();
return !!(
row?.is_pushing ||
pm2StatusOnline(row?.process_status) ||
["streaming", "source_live", "waiting_source", "youtube_key_rejected", "error"].includes(business)
);
}
function fmtEventDuration(seconds?: number | null): string {
const sec = Math.max(0, Math.floor(seconds || 0));
if (sec < 60) return `${sec}s`;
@ -670,7 +661,6 @@ export function LiveYoutubeUnmannedView({
const proUrlDraftRef = useRef(proUrlDraft);
const channelsRef = useRef<YoutubeProChannel[]>([]);
const currentProcRef = useRef(currentProc);
const singleProcessPm2SetRef = useRef<Set<string>>(new Set());
const urlRequestSeqRef = useRef(0);
const ytIniRequestSeqRef = useRef(0);
@ -710,10 +700,6 @@ export function LiveYoutubeUnmannedView({
channelsRef.current = channels;
}, [channels]);
useEffect(() => {
singleProcessPm2SetRef.current = new Set(singleProcessOptions.map((entry) => entry.pm2));
}, [singleProcessOptions]);
useEffect(() => {
urlRequestSeqRef.current += 1;
ytIniRequestSeqRef.current += 1;
@ -721,31 +707,12 @@ export function LiveYoutubeUnmannedView({
setUrlFetchNote(null);
}, [mode, activeCh]);
const updateActiveChannelUrlLines = useCallback((channelId: string, nextUrlLines: string) => {
if (!channelId) return;
setChannels((prev) => {
let changed = false;
const next = prev.map((row) => {
if (row.id !== channelId) return row;
if ((row.urlLines ?? "") === nextUrlLines) return row;
changed = true;
return { ...row, urlLines: nextUrlLines };
});
if (!changed) return prev;
channelsRef.current = next;
saveYoutubeProChannels(next);
return next;
});
}, []);
const pullUrlConfigFromServer = useCallback(async () => {
const targetProc = currentProcRef.current.trim();
if (!targetProc) return;
if (mode === "pro") {
const activePm2 = channelsRef.current.find((row) => row.id === activeCh);
if (!activePm2 || resolveChannelPm2(activePm2) !== targetProc) return;
} else if (singleProcessPm2SetRef.current.size && !singleProcessPm2SetRef.current.has(targetProc)) {
return;
}
const requestId = ++urlRequestSeqRef.current;
try {
@ -765,12 +732,11 @@ export function LiveYoutubeUnmannedView({
return;
}
applyProUrlDraft(c);
updateActiveChannelUrlLines(activeCh, c);
}
} catch {
/* ignore */
}
}, [activeCh, applyProUrlDraft, applySingleUrlDraft, fetchJson, mode, updateActiveChannelUrlLines]);
}, [activeCh, applyProUrlDraft, applySingleUrlDraft, fetchJson, mode]);
useEffect(() => {
if (!currentProc || !urlAutoRefresh) return;
@ -787,8 +753,6 @@ export function LiveYoutubeUnmannedView({
if (mode === "pro") {
const activePm2 = channelsRef.current.find((row) => row.id === activeCh);
if (!activePm2 || resolveChannelPm2(activePm2) !== targetProc) return;
} else if (singleProcessPm2SetRef.current.size && !singleProcessPm2SetRef.current.has(targetProc)) {
return;
}
setUrlReloading(true);
setUrlFetchNote(null);
@ -815,7 +779,6 @@ export function LiveYoutubeUnmannedView({
return;
}
applyProUrlDraft(c);
updateActiveChannelUrlLines(activeCh, c);
}
setUrlFetchNote(t("已从服务器读取 URL_config", "Reloaded URL_config from server"));
} catch (e) {
@ -870,7 +833,7 @@ export function LiveYoutubeUnmannedView({
name: "线路 1",
streamKey: "",
urlLines: "",
pm2Name: defaultPm2NameForChannel(id),
pm2Name: "youtube",
notes: "",
},
];
@ -903,29 +866,16 @@ export function LiveYoutubeUnmannedView({
[rowForPm2],
);
const currentProcRow = rowForPm2(currentProc);
const activeProRuntimeProc = active ? resolveChannelPm2(active) : "";
const activeProRuntimeRow = activeProRuntimeProc ? rowForPm2(activeProRuntimeProc) : undefined;
const singleRuntimeProc =
mode === "single" &&
activeProRuntimeProc &&
activeProRuntimeProc !== currentProc &&
hasVisibleRuntime(activeProRuntimeRow)
? activeProRuntimeProc
: currentProc;
const runtimeLogProc = mode === "single" ? singleRuntimeProc : currentProc;
const singleRuntimeProc = currentProc;
const runtimeLogProc = currentProc;
const runtimeLogRow = rowForPm2(runtimeLogProc);
const currentProcInSingleOptions = useMemo(
() => !!currentProc && singleProcessOptions.some((entry) => entry.pm2 === currentProc),
[currentProc, singleProcessOptions],
);
useEffect(() => {
if (mode !== "single" || !preferredSingleProc) return;
if (!currentProc || !currentProcInSingleOptions) {
if (!currentProc) {
currentProcRef.current = preferredSingleProc;
setCurrentProc(preferredSingleProc);
}
}, [currentProc, currentProcInSingleOptions, mode, preferredSingleProc, setCurrentProc]);
}, [currentProc, mode, preferredSingleProc, setCurrentProc]);
const applyChannelsLocal = useCallback((next: YoutubeProChannel[]) => {
const cleaned = cleanYoutubeProChannelNames(next);
@ -934,6 +884,21 @@ export function LiveYoutubeUnmannedView({
saveYoutubeProChannels(cleaned);
}, []);
const patchChannelLocalForPm2 = useCallback(
(pm2: string, patch: Partial<YoutubeProChannel>) => {
const target = pm2.trim();
if (!target) return;
let changed = false;
const next = channelsRef.current.map((row) => {
if (resolveChannelPm2(row) !== target) return row;
changed = true;
return { ...row, ...patch };
});
if (changed) applyChannelsLocal(next);
},
[applyChannelsLocal],
);
const syncChannelsRemote = useCallback(
async (next: YoutubeProChannel[], options: YoutubeProChannelsSyncOptions = {}) => {
await pushYoutubeProChannelsRemote(fetchJson, next, options);
@ -966,6 +931,25 @@ export function LiveYoutubeUnmannedView({
});
}, [active]);
useEffect(() => {
if (!active || resolveChannelPm2(active) !== "youtube") return;
const key = ytFields.key.trim();
if (!key) return;
setLaneDrafts((prev) => {
const draft = prev[active.id] ?? laneDraftFromChannel(active);
if (draft.streamKey.trim() === key && draft.pm2Name === "youtube") return prev;
if (draft.streamKey.trim()) return prev;
return {
...prev,
[active.id]: {
...draft,
streamKey: key,
pm2Name: "youtube",
},
};
});
}, [active, ytFields.key]);
useEffect(() => {
setLaneStatus(null);
}, [activeCh]);
@ -1126,166 +1110,33 @@ export function LiveYoutubeUnmannedView({
}
}, [activeCh, applyProUrlDraft, fetchJson, setCurrentProc]);
const syncActiveProToSingleProcess = useCallback(
async (targetPm2: string) => {
const target = targetPm2.trim();
if (!target || !active) return;
const streamKey = (activeLaneDraft?.streamKey ?? active.streamKey ?? "").trim();
const urlText = proUrlDraftRef.current || active.urlLines || "";
const base = parseYoutubeIniFields(youtubeIniText || buildYoutubeIniFromFields(ytFields));
const nextFields: YoutubeIniFields = {
key: streamKey,
rtmps: base.rtmps,
bitrate: base.bitrate,
fastAudio: base.fastAudio,
};
const nextIni = buildYoutubeIniFromFields(nextFields);
urlRequestSeqRef.current += 1;
ytIniRequestSeqRef.current += 1;
urlListDirtyRef.current = false;
applySingleUrlDraft(urlText);
setYoutubeIniText(nextIni);
setYtFields(nextFields);
setUrlFetchNote(t("已同步当前 Pro 线路到单频道", "Synced current Pro lane to single-channel"));
setYtIniStatus(t("已同步当前 Pro 线路到 single youtube.ini", "Synced current Pro lane to single youtube.ini"));
setUrlReloading(true);
setYtIniLoading(true);
try {
const params = new URLSearchParams({ process: target });
await fetchJson(`/save_config?${params}`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ content: nextIni }),
});
await fetchJson(`/save_url_config?${params}`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ content: urlText }),
});
if (target === currentProcRef.current.trim()) {
setActiveViewRefreshToken((prev) => prev + 1);
}
} catch (e) {
const message = e instanceof Error ? e.message : String(e);
setUrlFetchNote(message);
setYtIniStatus(message);
notify(message);
} finally {
setUrlReloading(false);
setYtIniLoading(false);
}
},
[active, activeLaneDraft, applySingleUrlDraft, fetchJson, notify, t, youtubeIniText, ytFields],
);
const syncSingleToActiveProProcess = useCallback(
async () => {
const targetChannel = (activeCh ? channels.find((row) => row.id === activeCh) : null) ?? channels[0];
if (!targetChannel) return;
const pm2 = resolveChannelPm2(targetChannel);
const urlText = singleUrlDraftRef.current;
const nextFields: YoutubeIniFields = {
key: ytFields.key.trim(),
rtmps: ytFields.rtmps,
bitrate: ytFields.bitrate,
fastAudio: ytFields.fastAudio,
};
const nextIni = buildYoutubeIniFromFields(nextFields);
const nextChannels = cleanYoutubeProChannelNames(channels.map((row) =>
row.id === targetChannel.id
? {
...row,
streamKey: nextFields.key,
urlLines: urlText,
pm2Name: pm2,
}
: row,
));
channelsRef.current = nextChannels;
setChannels(nextChannels);
saveYoutubeProChannels(nextChannels);
setLaneDrafts((prev) => ({
...prev,
[targetChannel.id]: {
...(prev[targetChannel.id] ?? laneDraftFromChannel(targetChannel)),
streamKey: nextFields.key,
pm2Name: pm2,
},
}));
setActiveCh(targetChannel.id);
applyProUrlDraft(urlText);
currentProcRef.current = pm2;
setCurrentProc(pm2);
setUrlFetchNote(t("已同步单频道到当前 Pro 线路", "Synced single-channel to current Pro lane"));
setYtIniStatus(t("已同步单频道到 Pro youtube.ini", "Synced single-channel to Pro youtube.ini"));
setUrlReloading(true);
setYtIniLoading(true);
try {
await syncChannelsRemote(nextChannels, { force: true });
const params = new URLSearchParams({ process: pm2 });
await fetchJson(`/save_config?${params}`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ content: nextIni }),
});
await fetchJson(`/save_url_config?${params}`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ content: urlText }),
});
if (pm2 === currentProcRef.current.trim()) {
setActiveViewRefreshToken((prev) => prev + 1);
}
} catch (e) {
const message = e instanceof Error ? e.message : String(e);
setUrlFetchNote(message);
setYtIniStatus(message);
notify(message);
} finally {
setUrlReloading(false);
setYtIniLoading(false);
}
},
[
activeCh,
applyProUrlDraft,
channels,
fetchJson,
notify,
setCurrentProc,
syncChannelsRemote,
t,
ytFields,
],
);
void refreshSingleProcessFromServer;
void refreshProChannelsFromServer;
const setModePersist = useCallback(
(m: "single" | "pro") => {
if (m === "pro" && mode === "single" && !ytFields.key.trim()) {
notify(t("请先填写并保存 YouTube 推流 key,再切换到多频道 Pro", "Fill and save the YouTube stream key before switching to Multi Pro"));
return;
}
if (m === "single") {
const target = preferredSingleProc || singleProcessOptions[0]?.pm2 || "";
const target = currentProcRef.current.trim() || preferredSingleProc || singleProcessOptions[0]?.pm2 || "";
if (target) {
currentProcRef.current = target;
setCurrentProc(target);
if (mode === "pro" && active) {
void syncActiveProToSingleProcess(target);
} else {
void refreshSingleProcessFromServer(target);
}
}
}
if (m === "pro" && channels.length) {
const ch = channels.find((c) => c.id === activeCh) ?? channels[0];
const current = currentProcRef.current.trim();
const ch = channels.find((c) => resolveChannelPm2(c) === current) ?? channels.find((c) => c.id === activeCh) ?? channels[0];
applyProUrlDraft((ch?.urlLines ?? "").trim());
if (ch) {
setActiveCh(ch.id);
const pm2 = resolveChannelPm2(ch);
currentProcRef.current = pm2;
setCurrentProc(pm2);
}
if (mode === "single") {
void syncSingleToActiveProProcess();
} else {
void refreshProChannelsFromServer();
}
}
setMode(m);
try {
@ -1298,24 +1149,18 @@ export function LiveYoutubeUnmannedView({
channels,
applyProUrlDraft,
activeCh,
active,
mode,
notify,
preferredSingleProc,
refreshProChannelsFromServer,
refreshSingleProcessFromServer,
setCurrentProc,
singleProcessOptions,
syncActiveProToSingleProcess,
syncSingleToActiveProProcess,
t,
ytFields.key,
],
);
const selectProChannel = useCallback(
(c: YoutubeProChannel) => {
const latestProUrlDraft = proUrlDraftRef.current;
if (active && mode === "pro" && latestProUrlDraft !== (active.urlLines ?? "").trim()) {
persistChannels(channels.map((x) => (x.id === active.id ? { ...x, urlLines: latestProUrlDraft } : x)));
}
const u = (c.urlLines ?? "").trim();
applyProUrlDraft(u);
setActiveCh(c.id);
@ -1323,7 +1168,7 @@ export function LiveYoutubeUnmannedView({
currentProcRef.current = pm2;
setCurrentProc(pm2);
},
[active, applyProUrlDraft, mode, channels, setCurrentProc, persistChannels],
[applyProUrlDraft, setCurrentProc],
);
useEffect(() => {
@ -1365,8 +1210,6 @@ export function LiveYoutubeUnmannedView({
if (!currentProc) return;
if (mode === "pro") {
if (!active || currentProc !== resolveChannelPm2(active)) return;
} else if (singleProcessPm2SetRef.current.size && !singleProcessPm2SetRef.current.has(currentProc)) {
return;
}
void pullUrlConfigFromServer();
void loadYoutubeIni();
@ -1464,6 +1307,7 @@ export function LiveYoutubeUnmannedView({
body: JSON.stringify({ content }),
});
setYoutubeIniText(content);
patchChannelLocalForPm2(targetPm2, { streamKey: parseYoutubeIniFields(content).key });
setYtIniStatus(t("youtube.ini 已保存", "youtube.ini saved"));
} catch (e) {
setYtIniStatus((e as Error).message);
@ -1510,16 +1354,12 @@ export function LiveYoutubeUnmannedView({
const keySuffixUi = useMemo(() => {
if (mode === "single") {
if (runtimeLogProc && runtimeLogProc !== currentProc && runtimeLogProc === activeProRuntimeProc) {
return parseYoutubeStreamKeySuffix(`key = ${active?.streamKey ?? ""}`);
}
return parseYoutubeStreamKeySuffix(`key = ${ytFields.key}`);
}
const k = activeLaneDraft?.streamKey ?? active?.streamKey ?? "";
return parseYoutubeStreamKeySuffix(`key = ${k}`);
}, [mode, runtimeLogProc, currentProc, activeProRuntimeProc, active?.streamKey, ytFields.key, activeLaneDraft?.streamKey]);
}, [mode, active?.streamKey, ytFields.key, activeLaneDraft?.streamKey]);
const keySuffixDisplay = keySuffixUi ? `…${keySuffixUi}` : "—";
const singleObservedDifferentProc = mode === "single" && !!runtimeLogProc && !!currentProc && runtimeLogProc !== currentProc;
const saveProUrlAndServer = async () => {
if (!active) return;
@ -1551,6 +1391,7 @@ export function LiveYoutubeUnmannedView({
try {
urlRequestSeqRef.current += 1;
await Promise.resolve(onSaveUrlConfig(singleUrlDraftRef.current, targetPm2));
patchChannelLocalForPm2(targetPm2, { urlLines: singleUrlDraftRef.current });
urlListDirtyRef.current = false;
} catch {
/* parent 已 toast */
@ -1783,11 +1624,7 @@ export function LiveYoutubeUnmannedView({
const singleRow = mode === "single" ? runtimeLogRow : currentProcRow;
const singleOnline = pm2StatusOnline(statusForPm2(singleRuntimeProc));
const singleSourceUrlText =
mode === "single" && runtimeLogProc === activeProRuntimeProc && runtimeLogProc !== currentProc
? active?.urlLines ?? proUrlDraft
: singleUrlDraft;
const singleSourceDisplay = douyinSourceDisplayFor(singleRow, singleSourceUrlText);
const singleSourceDisplay = douyinSourceDisplayFor(singleRow, singleUrlDraft);
const activeSourceDisplay = active
? douyinSourceDisplayFor(rowForPm2(resolveChannelPm2(active)), proUrlDraft || active.urlLines || "")
: "";
@ -2698,11 +2535,6 @@ export function LiveYoutubeUnmannedView({
<p className="mt-2 text-center text-sm font-semibold text-white">
{singleSourceDisplay || t("未配置抖音直播源", "No Douyin source configured")}
</p>
{singleObservedDifferentProc ? (
<p className="mt-2 text-center font-mono text-[10px] text-zinc-600">
{t("当前推流", "Streaming")}: {runtimeLogProc} · {t("当前编辑", "Editing")}: {currentProc}
</p>
) : null}
<p className="mt-3 text-center font-mono text-[11px] text-zinc-600">
key {t("尾码", "suffix")}: {keySuffixDisplay}
</p>
@ -2726,16 +2558,18 @@ export function LiveYoutubeUnmannedView({
const pm = resolveChannelPm2(c);
const row = rowForPm2(pm);
const st = statusForPm2(pm);
const laneUrls = nonCommentUrlLinesOf((c.urlLines ?? "").trim());
const douyinUrls = extractDouyinLiveUrls((c.urlLines ?? "").trim());
const dUrl = douyinUrls[0];
const suf = parseYoutubeStreamKeySuffix(`key = ${c.streamKey ?? ""}`);
const sel = activeCh === c.id;
const laneUrlText = sel ? proUrlDraft : (c.urlLines ?? "").trim();
const laneKeyText = sel ? activeLaneDraft?.streamKey ?? c.streamKey ?? "" : c.streamKey ?? "";
const laneUrls = nonCommentUrlLinesOf(laneUrlText);
const douyinUrls = extractDouyinLiveUrls(laneUrlText);
const dUrl = douyinUrls[0];
const suf = parseYoutubeStreamKeySuffix(`key = ${laneKeyText}`);
const rowOnline = pm2StatusOnline(st);
const laneIndex = channels.findIndex((row) => row.id === c.id);
const laneNeko = resolveNekoBrowserLink(nekoLinks, laneIndex).link;
const laneName = cleanLaneName(c.name, laneIndex >= 0 ? laneIndex : 0);
const laneDisplay = douyinSourceDisplayFor(row, c.urlLines ?? "");
const laneDisplay = douyinSourceDisplayFor(row, laneUrlText);
return (
<div
key={c.id}

View File

@ -15,7 +15,7 @@ export type YoutubeProChannel = {
const STORAGE_KEY = "live-hub-youtube-pro-v2";
const YOUTUBE_PRO_PM2_PREFIX = "youtube2__";
const PM2_SANITIZE_RE = /[^a-zA-Z0-9_.-]+/g;
const RESERVED_PRO_PM2_NAMES = new Set(["youtube", "douyin_youtube", "tiktok", "obs", "web"]);
const RESERVED_PRO_PM2_NAMES = new Set(["douyin_youtube", "tiktok", "obs", "web"]);
export function isBrokenYoutubeProLaneName(value: string | undefined): boolean {
const s = (value || "").trim();
@ -52,6 +52,7 @@ export function normalizeYoutubeProPm2Name(value: string, channelId: string): st
if (!raw || RESERVED_PRO_PM2_NAMES.has(raw) || raw === YOUTUBE_PRO_PM2_PREFIX) {
return defaultPm2NameForChannel(channelId);
}
if (raw === "youtube") return raw;
if (raw.startsWith(YOUTUBE_PRO_PM2_PREFIX)) return raw;
return defaultPm2NameForChannel(raw);
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[357],{2849:function(n,u,e){Promise.resolve().then(e.bind(e,3946))},3946:function(n,u,e){"use strict";e.r(u),e.d(u,{default:function(){return c}});var t=e(7437),r=e(2246);function c(){return(0,t.jsx)(r.d,{})}}},function(n){n.O(0,[500,246,971,117,744],function(){return n(n.s=2849)}),_N_E=n.O()}]);
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[357],{4579:function(n,u,e){Promise.resolve().then(e.bind(e,3946))},3946:function(n,u,e){"use strict";e.r(u),e.d(u,{default:function(){return c}});var t=e(7437),r=e(2246);function c(){return(0,t.jsx)(r.d,{})}}},function(n){n.O(0,[500,246,971,117,744],function(){return n(n.s=4579)}),_N_E=n.O()}]);

View File

@ -1 +1 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[443],{2820:function(n,u,e){Promise.resolve().then(e.bind(e,6367))},6367:function(n,u,e){"use strict";e.r(u),e.d(u,{default:function(){return c}});var t=e(7437),r=e(2246);function c(){return(0,t.jsx)(r.d,{})}}},function(n){n.O(0,[500,246,971,117,744],function(){return n(n.s=2820)}),_N_E=n.O()}]);
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[443],{6493:function(n,u,e){Promise.resolve().then(e.bind(e,6367))},6367:function(n,u,e){"use strict";e.r(u),e.d(u,{default:function(){return c}});var t=e(7437),r=e(2246);function c(){return(0,t.jsx)(r.d,{})}}},function(n){n.O(0,[500,246,971,117,744],function(){return n(n.s=6493)}),_N_E=n.O()}]);

View File

@ -1 +1 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{8422:function(e,a,_){Promise.resolve().then(_.t.bind(_,1511,23)),Promise.resolve().then(_.t.bind(_,2221,23)),Promise.resolve().then(_.t.bind(_,7960,23))},7960:function(){},2221:function(e){e.exports={style:{fontFamily:"'__geistMono_c3aa02', '__geistMono_Fallback_c3aa02'"},className:"__className_c3aa02",variable:"__variable_c3aa02"}},1511:function(e){e.exports={style:{fontFamily:"'__geistSans_1e4310', '__geistSans_Fallback_1e4310'"},className:"__className_1e4310",variable:"__variable_1e4310"}}},function(e){e.O(0,[776,971,117,744],function(){return e(e.s=8422)}),_N_E=e.O()}]);
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{2484:function(e,a,_){Promise.resolve().then(_.t.bind(_,1511,23)),Promise.resolve().then(_.t.bind(_,2221,23)),Promise.resolve().then(_.t.bind(_,7960,23))},7960:function(){},2221:function(e){e.exports={style:{fontFamily:"'__geistMono_c3aa02', '__geistMono_Fallback_c3aa02'"},className:"__className_c3aa02",variable:"__variable_c3aa02"}},1511:function(e){e.exports={style:{fontFamily:"'__geistSans_1e4310', '__geistSans_Fallback_1e4310'"},className:"__className_1e4310",variable:"__variable_1e4310"}}},function(e){e.O(0,[776,971,117,744],function(){return e(e.s=2484)}),_N_E=e.O()}]);

View File

@ -1 +0,0 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{5052:function(n,e,u){Promise.resolve().then(u.bind(u,7340))},7340:function(n,e,u){"use strict";u.r(e),u.d(e,{default:function(){return t.Z}});var t=u(7644)}},function(n){n.O(0,[500,166,246,644,971,117,744],function(){return n(n.s=5052)}),_N_E=n.O()}]);

View File

@ -0,0 +1 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{2195:function(n,e,u){Promise.resolve().then(u.bind(u,7340))},7340:function(n,e,u){"use strict";u.r(e),u.d(e,{default:function(){return t.Z}});var t=u(7644)}},function(n){n.O(0,[500,166,246,644,971,117,744],function(){return n(n.s=2195)}),_N_E=n.O()}]);

View File

@ -1 +1 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6],{7564:function(n,u,e){Promise.resolve().then(e.bind(e,3398))},3398:function(n,u,e){"use strict";e.r(u),e.d(u,{default:function(){return c}});var t=e(7437),r=e(2246);function c(){return(0,t.jsx)(r.d,{})}}},function(n){n.O(0,[500,246,971,117,744],function(){return n(n.s=7564)}),_N_E=n.O()}]);
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6],{3330:function(n,u,e){Promise.resolve().then(e.bind(e,3398))},3398:function(n,u,e){"use strict";e.r(u),e.d(u,{default:function(){return c}});var t=e(7437),r=e(2246);function c(){return(0,t.jsx)(r.d,{})}}},function(n){n.O(0,[500,246,971,117,744],function(){return n(n.s=3330)}),_N_E=n.O()}]);

View File

@ -1 +0,0 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[851],{2276:function(n,e,u){Promise.resolve().then(u.bind(u,316))},316:function(n,e,u){"use strict";u.r(e),u.d(e,{default:function(){return t.Z}});var t=u(7644)}},function(n){n.O(0,[500,166,246,644,971,117,744],function(){return n(n.s=2276)}),_N_E=n.O()}]);

View File

@ -0,0 +1 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[851],{8797:function(n,e,u){Promise.resolve().then(u.bind(u,316))},316:function(n,e,u){"use strict";u.r(e),u.d(e,{default:function(){return t.Z}});var t=u(7644)}},function(n){n.O(0,[500,166,246,644,971,117,744],function(){return n(n.s=8797)}),_N_E=n.O()}]);

View File

@ -1 +0,0 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[744],{5629:function(e,n,t){Promise.resolve().then(t.t.bind(t,2846,23)),Promise.resolve().then(t.t.bind(t,9107,23)),Promise.resolve().then(t.t.bind(t,1060,23)),Promise.resolve().then(t.t.bind(t,4707,23)),Promise.resolve().then(t.t.bind(t,80,23)),Promise.resolve().then(t.t.bind(t,6423,23))}},function(e){var n=function(n){return e(e.s=n)};e.O(0,[971,117],function(){return n(4278),n(5629)}),_N_E=e.O()}]);

View File

@ -0,0 +1 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[744],{396:function(e,n,t){Promise.resolve().then(t.t.bind(t,2846,23)),Promise.resolve().then(t.t.bind(t,9107,23)),Promise.resolve().then(t.t.bind(t,1060,23)),Promise.resolve().then(t.t.bind(t,4707,23)),Promise.resolve().then(t.t.bind(t,80,23)),Promise.resolve().then(t.t.bind(t,6423,23))}},function(e){var n=function(n){return e(e.s=n)};e.O(0,[971,117],function(){return n(4278),n(396)}),_N_E=e.O()}]);

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
2:I[9107,[],"ClientPageRoot"]
3:I[3946,["500","static/chunks/500-ea37cc8de90441f7.js","246","static/chunks/246-a56380dcf5ea0340.js","357","static/chunks/app/android/page-69ff6e74a15b80d9.js"],"default",1]
3:I[3946,["500","static/chunks/500-ea37cc8de90441f7.js","246","static/chunks/246-a56380dcf5ea0340.js","357","static/chunks/app/android/page-5f87422c86e34807.js"],"default",1]
4:I[4707,[],""]
5:I[6423,[],""]
0:["0T-XrNk19a9ZMkGFefL9K",[[["",{"children":["android",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["android",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","android","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/d69107dc7d1c5fad.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"zh-CN","data-theme":"dark","suppressHydrationWarning":true,"children":["$","body",null,{"className":"__variable_1e4310 __variable_c3aa02 font-sans antialiased","children":[["$","div",null,{"className":"app-bg-layer","aria-hidden":true}],["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]]}]}]],null],null],["$L6",null]]]]
0:["qH1zlSt29jtuHZ9NIMYFr",[[["",{"children":["android",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["android",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","android","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/d69107dc7d1c5fad.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"zh-CN","data-theme":"dark","suppressHydrationWarning":true,"children":["$","body",null,{"className":"__variable_1e4310 __variable_c3aa02 font-sans antialiased","children":[["$","div",null,{"className":"app-bg-layer","aria-hidden":true}],["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]]}]}]],null],null],["$L6",null]]]]
6:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"无人直播系统 · live.local"}],["$","meta","3",{"name":"description","content":"Linux ARM/x86 一键部署的无人直播控制台:YouTube 转播、TikTok HDMI、SRS、Neko 与系统服务"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}]]
1:null

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
2:I[9107,[],"ClientPageRoot"]
3:I[6367,["500","static/chunks/500-ea37cc8de90441f7.js","246","static/chunks/246-a56380dcf5ea0340.js","443","static/chunks/app/console/page-db00fd3a990c6a05.js"],"default",1]
3:I[6367,["500","static/chunks/500-ea37cc8de90441f7.js","246","static/chunks/246-a56380dcf5ea0340.js","443","static/chunks/app/console/page-f5a0052a001f3016.js"],"default",1]
4:I[4707,[],""]
5:I[6423,[],""]
0:["0T-XrNk19a9ZMkGFefL9K",[[["",{"children":["console",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["console",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","console","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/d69107dc7d1c5fad.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"zh-CN","data-theme":"dark","suppressHydrationWarning":true,"children":["$","body",null,{"className":"__variable_1e4310 __variable_c3aa02 font-sans antialiased","children":[["$","div",null,{"className":"app-bg-layer","aria-hidden":true}],["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]]}]}]],null],null],["$L6",null]]]]
0:["qH1zlSt29jtuHZ9NIMYFr",[[["",{"children":["console",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["console",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","console","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/d69107dc7d1c5fad.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"zh-CN","data-theme":"dark","suppressHydrationWarning":true,"children":["$","body",null,{"className":"__variable_1e4310 __variable_c3aa02 font-sans antialiased","children":[["$","div",null,{"className":"app-bg-layer","aria-hidden":true}],["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]]}]}]],null],null],["$L6",null]]]]
6:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"无人直播系统 · live.local"}],["$","meta","3",{"name":"description","content":"Linux ARM/x86 一键部署的无人直播控制台:YouTube 转播、TikTok HDMI、SRS、Neko 与系统服务"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}]]
1:null

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
2:I[9107,[],"ClientPageRoot"]
3:I[7340,["500","static/chunks/500-ea37cc8de90441f7.js","166","static/chunks/166-6b01e1456a874782.js","246","static/chunks/246-a56380dcf5ea0340.js","644","static/chunks/644-fd6fe0f98d73fa51.js","931","static/chunks/app/page-505467ca9505824f.js"],"default",1]
3:I[7340,["500","static/chunks/500-ea37cc8de90441f7.js","166","static/chunks/166-6b01e1456a874782.js","246","static/chunks/246-a56380dcf5ea0340.js","644","static/chunks/644-b670e35fa0cddabc.js","931","static/chunks/app/page-58e06160be396c5b.js"],"default",1]
4:I[4707,[],""]
5:I[6423,[],""]
0:["0T-XrNk19a9ZMkGFefL9K",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/d69107dc7d1c5fad.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"zh-CN","data-theme":"dark","suppressHydrationWarning":true,"children":["$","body",null,{"className":"__variable_1e4310 __variable_c3aa02 font-sans antialiased","children":[["$","div",null,{"className":"app-bg-layer","aria-hidden":true}],["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]]}]}]],null],null],["$L6",null]]]]
0:["qH1zlSt29jtuHZ9NIMYFr",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/d69107dc7d1c5fad.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"zh-CN","data-theme":"dark","suppressHydrationWarning":true,"children":["$","body",null,{"className":"__variable_1e4310 __variable_c3aa02 font-sans antialiased","children":[["$","div",null,{"className":"app-bg-layer","aria-hidden":true}],["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]]}]}]],null],null],["$L6",null]]]]
6:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"无人直播系统 · live.local"}],["$","meta","3",{"name":"description","content":"Linux ARM/x86 一键部署的无人直播控制台:YouTube 转播、TikTok HDMI、SRS、Neko 与系统服务"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}]]
1:null

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
2:I[9107,[],"ClientPageRoot"]
3:I[3398,["500","static/chunks/500-ea37cc8de90441f7.js","246","static/chunks/246-a56380dcf5ea0340.js","6","static/chunks/app/shellcrash/page-766863ba520c08ee.js"],"default",1]
3:I[3398,["500","static/chunks/500-ea37cc8de90441f7.js","246","static/chunks/246-a56380dcf5ea0340.js","6","static/chunks/app/shellcrash/page-0c73522b1d5c8dc1.js"],"default",1]
4:I[4707,[],""]
5:I[6423,[],""]
0:["0T-XrNk19a9ZMkGFefL9K",[[["",{"children":["shellcrash",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["shellcrash",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","shellcrash","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/d69107dc7d1c5fad.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"zh-CN","data-theme":"dark","suppressHydrationWarning":true,"children":["$","body",null,{"className":"__variable_1e4310 __variable_c3aa02 font-sans antialiased","children":[["$","div",null,{"className":"app-bg-layer","aria-hidden":true}],["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]]}]}]],null],null],["$L6",null]]]]
0:["qH1zlSt29jtuHZ9NIMYFr",[[["",{"children":["shellcrash",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["shellcrash",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","shellcrash","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/d69107dc7d1c5fad.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"zh-CN","data-theme":"dark","suppressHydrationWarning":true,"children":["$","body",null,{"className":"__variable_1e4310 __variable_c3aa02 font-sans antialiased","children":[["$","div",null,{"className":"app-bg-layer","aria-hidden":true}],["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]]}]}]],null],null],["$L6",null]]]]
6:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"无人直播系统 · live.local"}],["$","meta","3",{"name":"description","content":"Linux ARM/x86 一键部署的无人直播控制台:YouTube 转播、TikTok HDMI、SRS、Neko 与系统服务"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}]]
1:null

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
2:I[9107,[],"ClientPageRoot"]
3:I[316,["500","static/chunks/500-ea37cc8de90441f7.js","166","static/chunks/166-6b01e1456a874782.js","246","static/chunks/246-a56380dcf5ea0340.js","644","static/chunks/644-fd6fe0f98d73fa51.js","851","static/chunks/app/youtube-events/page-505c03a44db53360.js"],"default",1]
3:I[316,["500","static/chunks/500-ea37cc8de90441f7.js","166","static/chunks/166-6b01e1456a874782.js","246","static/chunks/246-a56380dcf5ea0340.js","644","static/chunks/644-b670e35fa0cddabc.js","851","static/chunks/app/youtube-events/page-de7151b95af37543.js"],"default",1]
4:I[4707,[],""]
5:I[6423,[],""]
0:["0T-XrNk19a9ZMkGFefL9K",[[["",{"children":["youtube-events",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["youtube-events",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","youtube-events","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/d69107dc7d1c5fad.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"zh-CN","data-theme":"dark","suppressHydrationWarning":true,"children":["$","body",null,{"className":"__variable_1e4310 __variable_c3aa02 font-sans antialiased","children":[["$","div",null,{"className":"app-bg-layer","aria-hidden":true}],["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]]}]}]],null],null],["$L6",null]]]]
0:["qH1zlSt29jtuHZ9NIMYFr",[[["",{"children":["youtube-events",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["youtube-events",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}],null],null],null]},[null,["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","youtube-events","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined"}]],null]},[[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/d69107dc7d1c5fad.css","precedence":"next","crossOrigin":"$undefined"}]],["$","html",null,{"lang":"zh-CN","data-theme":"dark","suppressHydrationWarning":true,"children":["$","body",null,{"className":"__variable_1e4310 __variable_c3aa02 font-sans antialiased","children":[["$","div",null,{"className":"app-bg-layer","aria-hidden":true}],["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[]}]]}]}]],null],null],["$L6",null]]]]
6:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"无人直播系统 · live.local"}],["$","meta","3",{"name":"description","content":"Linux ARM/x86 一键部署的无人直播控制台:YouTube 转播、TikTok HDMI、SRS、Neko 与系统服务"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}]]
1:null

View File

@ -26,6 +26,9 @@
"postcss": "^8",
"tailwindcss": "^3.4.1",
"typescript": "^5"
},
"engines": {
"node": ">=18.18"
}
},
"node_modules/@alloc/quick-lru": {

View File

@ -352,6 +352,31 @@ def _sync_youtube_pro_runtime_files(process: str) -> list[str]:
return errors
def _youtube_pro_channel_for_process(process: str) -> dict[str, Any] | None:
target = (process or "").strip()
if not target:
return None
for channel in get_youtube_pro_channels():
if not isinstance(channel, dict):
continue
if channel_pm2_name(channel) == target:
return dict(channel)
return None
def _missing_managed_file_notice(rel: str) -> str:
return f"# {rel} has not been created yet; save to write it to disk.\n"
def _youtube_ini_content_from_channel(channel: dict[str, Any] | None) -> str:
if not channel:
return ""
key = str(channel.get("streamKey") or "").strip()
if not key:
return ""
rtmps = "0" if key.lower().startswith("rtmp://") else "1"
return f"[youtube]\nkey = {key}\nrtmps = {rtmps}\nfast_audio = 1\n"
def _normalize_textarea_content(text: str) -> str:
return (text or "").replace("\r\n", "\n").replace("\r", "\n").lstrip("\ufeff")
@ -1501,16 +1526,19 @@ async def get_config(request: Request, process: str = Query(..., description="
config_file = CONFIG_DIR / rel
if not config_file.is_file():
sync_errors = _sync_youtube_pro_runtime_files(process)
if sync_errors:
return JSONResponse({"error": "; ".join(sync_errors)}, status_code=400)
channel = _youtube_pro_channel_for_process(process)
channel_content = _youtube_ini_content_from_channel(channel)
if channel_content:
return JSONResponse({"content": channel_content}, headers=_NO_STORE_HEADERS)
if channel and channel_pm2_name(channel) != "youtube":
return JSONResponse({"content": _missing_managed_file_notice(rel)}, headers=_NO_STORE_HEADERS)
legacy = CONFIG_DIR / "youtube.ini"
if legacy.is_file():
try:
return JSONResponse({"content": legacy.read_text(encoding="utf-8")}, headers=_NO_STORE_HEADERS)
except OSError as e:
return JSONResponse({"error": f"读取失败: {str(e)}"}, status_code=500)
return JSONResponse({"content": f"# {rel} 尚未创建,保存后将写入磁盘\n"}, headers=_NO_STORE_HEADERS)
return JSONResponse({"content": _missing_managed_file_notice(rel)}, headers=_NO_STORE_HEADERS)
try:
content = config_file.read_text(encoding="utf-8")
return JSONResponse({"content": content}, headers=_NO_STORE_HEADERS)
@ -1557,16 +1585,19 @@ async def get_url_config(request: Request, process: str = Query(..., description
rel = managed_url_config_relpath(process)
config_file = CONFIG_DIR / rel
if not config_file.is_file():
sync_errors = _sync_youtube_pro_runtime_files(process)
if sync_errors:
return JSONResponse({"error": "; ".join(sync_errors)}, status_code=400)
channel = _youtube_pro_channel_for_process(process)
channel_content = _normalize_textarea_content(str(channel.get("urlLines") or "")) if channel else ""
if channel_content.strip():
return JSONResponse({"content": channel_content}, headers=_NO_STORE_HEADERS)
if channel and channel_pm2_name(channel) != "youtube":
return JSONResponse({"content": _missing_managed_file_notice(rel)}, headers=_NO_STORE_HEADERS)
legacy = CONFIG_DIR / "URL_config.ini"
if legacy.is_file():
try:
return JSONResponse({"content": legacy.read_text(encoding="utf-8")}, headers=_NO_STORE_HEADERS)
except OSError as e:
return JSONResponse({"error": f"读取失败: {str(e)}"}, status_code=500)
return JSONResponse({"content": f"# {rel} 尚未创建,保存后将写入磁盘\n"}, headers=_NO_STORE_HEADERS)
return JSONResponse({"content": _missing_managed_file_notice(rel)}, headers=_NO_STORE_HEADERS)
try:
content = config_file.read_text(encoding="utf-8")
return JSONResponse({"content": content}, headers=_NO_STORE_HEADERS)