Document Neko CDP gate before FFmpeg in README.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
eric 2026-09-01 11:42:10 -05:00
parent 0020559307
commit a35088be13
2 changed files with 51 additions and 0 deletions

View File

@ -159,6 +159,15 @@ Windows 上可用 `python scripts\_deploy.py`(需自行配置 SSH 目标,**
| **画质预设** | `youtube_relay_quality_preset`(如 `720p`、`vps_ultra`);含分辨率、码率、AAC **128k** |
| **Cookie** | 解析拉流地址依赖 `dy_cookie`(同 sh2 `[Cookie]抖音cookie`);缺失时保持监听、不退出 Worker |
**Neko → FFmpeg 启动门控**(时间段 / 独占模式):
1. 启动 winner 的 Neko 容器
2. **等待 YouTube Live 控制页就绪**(禁止抢跑,避免 YouTube 绿点 loading 无效 ingest)
- 优先:Chrome 扩展遥测 → `POST /hub/youtube/live/ingest`
- 备用:**CDP** 在容器内查 `127.0.0.1:9222`,确认 `studio.youtube.com/.../livestreaming` 标签存在
- 检测到后 **稳定 ≥20s** 再启动 FFmpeg
3. `GET /api/youtube/relay/status` 的 `studio_live` 字段反映当前是否检测到 Live 页(`detect_source`: `telemetry` / `cdp`)
**状态(UI)**:推流中 / 转推启动中 / 等待直播 / 监听中 / 低速推流 等,由 `youtube_relay_status.py` 根据 FFmpeg 日志与进程态汇总;**推流中不会显示「无法开始」**。
**与 Shorts 关系**:不复用 sh2 RTMP 旁路;Shorts 仍为可选短成片上传。全局 SOCKS 规划见 [全局 SOCKS5](#全局-socks5sing-box--proxychains)。

View File

@ -0,0 +1,42 @@
# -*- coding: utf-8 -*-
import json
import paramiko
import sys
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
c = paramiko.SSHClient()
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect("108.174.50.68", 22, "root", "Xiao4669805", timeout=60, allow_agent=False, look_for_keys=False)
REMOTE = r"""
curl -sS -c /tmp/dy.ck -X POST https://dy.nomadro.live/api/auth/login \
-H 'Content-Type: application/json' \
-d '{"username":"hackrobot","password":"Xiao4669805@"}' >/dev/null
curl -sS -b /tmp/dy.ck https://dy.nomadro.live/api/youtube/relay/status -o /tmp/r.json
python3 <<'PY'
import json
from pathlib import Path
d=json.loads(Path('/tmp/r.json').read_text())
print('slot', d.get('settings',{}).get('youtube_relay_time_slot_mode'))
print('studio_live', d.get('studio_live'))
print('pushing', d.get('pushing_count'))
for ch in (d.get('schedule') or {}).get('channels') or []:
if ch.get('active'):
print('ACTIVE', ch.get('name'), ch.get('start_label'), '-', ch.get('end_label'))
for g in d.get('groups',[]):
st=str(g.get('status') or '')
if g.get('is_pushing') or st in ('starting','waiting','pushing') or '大师兄' in str(g.get('name','')) or 'Evan' in str(g.get('name','')):
print('---', g.get('name'), st, g.get('business_status'), 'push', g.get('is_pushing'))
if g.get('error'): print(' err', str(g.get('error'))[:120])
rl=g.get('recent_log')
if isinstance(rl,list):
for line in rl[-4:]:
print(' ', line[:180])
PY
ps aux | grep -E '[f]fmpeg.*live2' | wc -l
"""
_, o, _ = c.exec_command(REMOTE, timeout=90)
print(o.read().decode())
c.close()