#!/usr/bin/env python3 import paramiko def q(host, pw, cmd): c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy()) c.connect(host, username='eric', password=pw, timeout=15) _, o, e = c.exec_command(cmd, timeout=60, get_pty=True) r = (o.read()+e.read()).decode('utf-8','replace'); c.close(); return r pw='4669805' host='10.88.0.5' cmds=[ 'cat /opt/live/d2ypp/config/hardware.env 2>/dev/null', 'cat /opt/live/d2ypp/config/hardware-profile.json 2>/dev/null | head -c 2000', 'grep -H "video_mode\\|fast_audio\\|bitrate" /opt/live/d2ypp/config/youtube.youtube2__*.ini 2>/dev/null | head -30', 'cat /opt/live/d2ypp/config/system-stack.env 2>/dev/null | grep -E SHELLCRASH|YOUTUBE|PUSH|RELAY|PROXY', 'ls /opt/live/d2ypp/config/youtube.youtube2__*.ini 2>/dev/null', 'md5sum /opt/live/d2ypp/douyin_youtube_ffplay.py /home/eric/d2ypp2-src/douyin_youtube_ffplay.py 2>/dev/null', ] for cmd in cmds: print('>',cmd) print(q(host,pw,cmd)[:2500].encode('ascii','backslashreplace').decode())