# -*- 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 = 420) -> str: _, out, err = c.exec_command(cmd, timeout=timeout) return (out.read() + err.read()).decode("utf-8", "replace").strip() cmd = r""" export DY_S3_ENABLED=true export DY_S3_ENDPOINT=http://127.0.0.1:8333 export DY_S3_PUBLIC_BASE=https://s3.nomadro.com export DY_S3_ACCESS_KEY=douyin export DY_S3_SECRET_KEY=douyinweb_s3_2026 export DY_S3_BUCKET=douyin-covers export DY_S3_REGION=us-east-1 cd /opt/douyinWEB/backend /opt/douyinWEB/backend/.venv/bin/python /opt/douyinWEB/scripts/_publish_downloads.py --ext-only """ print(run(cmd + " 2>&1 | tr -cd '\\11\\12\\15\\40-\\176' | tail -n 50", timeout=420)) print( run( "curl -sSI -m 15 https://s3.nomadro.com/douyin-covers/downloads/extension/dylive-helper-latest.zip " "| tr -cd '\\11\\12\\15\\40-\\176' | head -n 12" ) ) # verify media.fetch is in built background on server after publish build print( run( "grep -o 'media.fetch' /opt/douyinWEB/extensions/dylive-helper/dist/background.js | head -n 3; " "python3 -c \"import json; print(json.load(open('/opt/douyinWEB/extensions/dylive-helper/manifest.json')).get('version'))\"" ) ) c.close() print("DONE")