douyinWEB/scripts/_probe_s3_media.py
eric d409e416da Ship physical dual-edge stack, Studio CDP live metrics, and ops tooling.
Capture Neko/WG/network hubs, Studio viewer charts, physical deploy docs, and one-shot scripts so VPS vs physical can be toggled later without losing WIP.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-04 22:42:40 -05:00

36 lines
1.1 KiB
Python

# -*- coding: utf-8 -*-
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("107.173.30.245", 22, "root", "Xiao4669805", timeout=30, allow_agent=False, look_for_keys=False)
def run(cmd: str, timeout: int = 60) -> str:
_, out, err = c.exec_command(cmd, timeout=timeout)
return (out.read() + err.read()).decode("utf-8", "replace").strip()
url = (
"https://s3.nomadro.com/douyin-covers/downloads/x2-media/20260815/83bb2a9b85b5_xclip_d6daab96.mp4"
)
print(
run(
f"curl -sS -m 20 -o /tmp/xclip_probe.mp4 -w 'http=%{{http_code}} size=%{{size_download}} type=%{{content_type}}' '{url}'; "
"ls -lh /tmp/xclip_probe.mp4 2>/dev/null | tr -cd '\\11\\12\\15\\40-\\176'"
)
)
print(
run(
"curl -sSI -m 15 'https://s3.nomadro.com/douyin-covers/downloads/x2-media/20260815/83bb2a9b85b5_xclip_d6daab96.mp4' "
"| tr -cd '\\11\\12\\15\\40-\\176' | head -n 25"
)
)
c.close()