Smail/test/tools/check_assets.py
smail 9813c9cd0f
Some checks are pending
Security Checks / security (push) Waiting to run
test: 增加刷新按钮与定时轮询机制云端部署端到端验收脚本
2026-09-14 09:28:25 +08:00

13 lines
576 B
Python

import urllib.request, ssl, re
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
opener = urllib.request.build_opener(urllib.request.HTTPSHandler(context=ctx))
req = opener.open("https://47.108.78.12/", timeout=5)
html = req.read().decode("utf-8")
js_files = re.findall(r"/assets/[a-zA-Z0-9_.-]+.js", html)
print("Referenced JS files:", js_files)
for j in js_files:
r = opener.open(f"https://47.108.78.12{j}", timeout=5)
txt = r.read().decode("utf-8")
print(f"{j}: size {len(txt)}, contains refresh: {'refresh' in txt}")