Spaces:
Running
Running
Download export_still.py from HuggingFaceBio/carbon-a-release: direct link, hf CLI and curl.
- Browser
- Download file 702 Bytes
-
https://huggingface.co/spaces/HuggingFaceBio/carbon-a-release/resolve/main/export_still.py
- Command line
-
hf download hf://spaces/HuggingFaceBio/carbon-a-release/export_still.py
-
curl -L -o export_still.py https://huggingface.co/spaces/HuggingFaceBio/carbon-a-release/resolve/main/export_still.py
702 Bytes
| """Export the current presentation at 2× resolution, without capture controls.""" | |
| from pathlib import Path | |
| import sys | |
| sys.path.insert(0,'/home/node/local/carbon-a-render/python') | |
| from playwright.sync_api import sync_playwright | |
| from check_presentation import BROWSER,ARGS | |
| R=Path(__file__).parent | |
| with sync_playwright() as p: | |
| b=p.chromium.launch(executable_path=BROWSER,args=ARGS) | |
| page=b.new_page(viewport={'width':1080,'height':1350},device_scale_factor=2) | |
| page.goto((R/'index.html').as_uri()+'?record=1') | |
| page.wait_for_function('window.POC && !document.querySelector("#loading")',timeout=60000) | |
| page.screenshot(path=str(R/'carbon-a-strand-poc.png')) | |
| b.close() | |
| print(R/'carbon-a-strand-poc.png') | |