douyinWEB/scripts/_check_dy_neko7_now.py
2026-09-13 22:10:49 -05:00

33 lines
1.1 KiB
Python

#!/usr/bin/env python3
from __future__ import annotations
import sys
import paramiko
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=45, allow_agent=False, look_for_keys=False, banner_timeout=180)
_i, o, e = c.exec_command(
r"""
set +e
docker exec douyinweb-neko-7 python3 -c '
import json,urllib.request
tabs=json.loads(urllib.request.urlopen("http://127.0.0.1:9222/json/list",timeout=5).read())
for t in tabs:
if t.get("type")=="page":
print((t.get("title") or "")[:80])
print(" ", (t.get("url") or "")[:120])
'
echo '---'
# stop unexpected neko-8 if we did not need it
docker stop douyinweb-neko-8 2>/dev/null && echo stopped_neko8 || true
docker ps --filter name=douyinweb-neko --format '{{.Names}} {{.Status}}'
dmesg -T 2>/dev/null | grep -i 'invalid opcode' | tail -2
curl -sk -o /dev/null -w 'neko7:%{http_code}\n' https://dy.nomadro.live/neko/7/
""",
timeout=60,
)
print((o.read() + e.read()).decode("utf-8", "replace"))
c.close()