Spaces:
Running
Running
Download scripts/xtest.py from Ethscriptions/mx: direct link, hf CLI and curl.
- Browser
- Download file 810 Bytes
-
https://huggingface.co/spaces/Ethscriptions/mx/resolve/main/scripts/xtest.py
- Command line
-
hf download hf://spaces/Ethscriptions/mx/scripts/xtest.py
-
curl -L -o xtest.py https://huggingface.co/spaces/Ethscriptions/mx/resolve/main/scripts/xtest.py
810 Bytes
| """Short (3s) MP4 export smoke test in headless Chromium -> /tmp/x.mp4""" | |
| import asyncio, base64 | |
| from playwright.async_api import async_playwright | |
| async def main(): | |
| async with async_playwright() as p: | |
| b = await p.chromium.launch(args=["--use-gl=angle","--use-angle=swiftshader","--enable-unsafe-swiftshader"]) | |
| pg = await b.new_page() | |
| pg.on("console", lambda m: print(m.text[:300]) if "INFO" in m.text or m.type=="error" else None) | |
| await pg.goto("http://localhost:5173/preview/production/ed5ba841-ed53-4eec-a8c5-93237d26b7ab/?xdebug=1") | |
| await pg.wait_for_function("window.__done === true", timeout=400000) | |
| d = await pg.evaluate("window.__mp4 || ''") | |
| if d: open("/tmp/x.mp4","wb").write(base64.b64decode(d)) | |
| await b.close() | |
| asyncio.run(main()) | |