21 lines
1.1 KiB
Python
21 lines
1.1 KiB
Python
#!/usr/bin/env python3
|
|
import paramiko, sys
|
|
|
|
c = paramiko.SSHClient()
|
|
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
c.connect("10.88.0.4", username="eric", password="4669805", timeout=15)
|
|
cmds = [
|
|
"grep -H 'video_mode\\|bitrate' /home/eric/d2ypp2-src/config/youtube.youtube2__*.ini 2>/dev/null | head -15 || echo no_copy_lines",
|
|
"grep relay_strategy /home/eric/d2ypp2-src/config/hardware-profile.json || echo no_relay_strategy",
|
|
"curl -sS -m 8 -x socks5://127.0.0.1:7890 https://www.gstatic.com/generate_204 -w 'gstatic=%{http_code} t=%{time_total}\n' -o /dev/null",
|
|
"curl -sS -m 10 -x socks5://127.0.0.1:7890 https://a.rtmps.youtube.com/ -w 'yt_t=%{time_total}\n' -o /dev/null 2>&1 | tail -1",
|
|
"pgrep -af 'ffmpeg.*rtmps' || echo no_ffmpeg",
|
|
"grep -hE 'stream copy|transcode|YouTube Live profile' /home/eric/d2ypp2-src/.pm2/logs/youtube2__*-out.log 2>/dev/null | tail -4",
|
|
]
|
|
for cmd in cmds:
|
|
_, o, e = c.exec_command(cmd, timeout=45, get_pty=True)
|
|
out = (o.read() + e.read()).decode("utf-8", "replace")
|
|
sys.stdout.buffer.write(f"\n> {cmd[:70]}\n".encode())
|
|
sys.stdout.buffer.write(out.encode("utf-8", "replace"))
|
|
c.close()
|