sh2/d2ypp2/tools/query_host03_downloads.py
eric 278b48497e Add YouTube relay log tooling and optional hub service controls.
This captures the current live stack updates across the API, Linux service scripts, tests, diagnostics, and exported console assets so the Ubuntu deployment can pull a consistent test3 build.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-30 05:10:09 -05:00

36 lines
1.1 KiB
Python

#!/usr/bin/env python3
import paramiko
HOST, USER, PASS = "10.88.0.3", "eric", "Xiao4669805"
REMOTE = r'''
import os, glob, time
from datetime import datetime
base="/opt/live/d2ypp/downloads"
hits=[]
for path in glob.glob(base + "/**/*", recursive=True):
try:
if not os.path.isfile(path): continue
m=os.path.getmtime(path)
hits.append((m, path, os.path.getsize(path)))
except: pass
hits.sort(reverse=True)
print('total files', len(hits))
for m,p,s in hits[:60]:
print(datetime.fromtimestamp(m).isoformat(), round(s/1024/1024,1), 'MB', p)
print('\n=== files between 05:00-08:00 ===')
for m,p,s in hits:
ts=datetime.fromtimestamp(m)
if ts.date().isoformat()=='2026-06-24' and 5 <= ts.hour < 8:
print(ts.isoformat(), round(s/1024/1024,1), 'MB', p)
'''
def main():
c=paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect(HOST, username=USER, password=PASS, timeout=15)
_,o,e=c.exec_command(f"python3 - <<'PY'\n{REMOTE}\nPY", timeout=120, get_pty=True)
import sys; sys.stdout.buffer.write((o.read()+e.read())[:30000])
c.close()
if __name__=='__main__': main()