Repository navigation
shot-scraper video command, with storyboard.yml files - #194
Conversation
server option is consistent with the shot-scraper multi one.
Used on the video.md page.
|
It's mostly working, but there's one very annoying bug: output: datasette-example.webm
url: https://latest.datasette.io/
cursor: true
viewport:
width: 1024
height: 768
scenes:
- name: Datasette homepage
wait_for: h1
hold: 1
- name: Open the fixtures database
do:
- click: "h2 a[href='/fixtures']"
- wait_for: "text=Custom SQL query"
hold: 1
- name: Enter a SQL query
do:
- click: ".cm-content[contenteditable='true']"
- press:
selector: ".cm-content[contenteditable='true']"
key: ControlOrMeta+A
- type:
into: ".cm-content[contenteditable='true']"
text: |
select _neighborhood, state
from facetable
where state = "MI"
order by _neighborhood
delay: 35
hold: 1
- name: Run the query
do:
- click: "input[type='submit'][value='Run SQL']"
- wait_for: "text=Custom SQL query returning 4 rows"
hold: 2That storyboard file is run like this: uv run shot-scraper video datasette-example.ymlAnd produces this video - which starts with a white frame! datasette-example.webm |
|
The problem is Playwright starts recording at the start of the session and captures a moment of |
|
We were on Playwright 1.58 but it turns out Playwright 1.59 adds a new "screencast" API which may be a better fit for this: https://playwright.dev/python/docs/api/class-page#page-screencast |
|
It looks like the screencast() API is currently limited to fixed size videos at 800px But Playwright has fixed that already, and it's fixed in Playwright Python |
This limits video to 800px width though, see: #194 (comment)
|
I'm going to pause working on this until that Playwright Python release comes out. |
b852c93 to
0d17627
Compare
|
https://github.com/microsoft/playwright-python/releases/tag/v1.61.0 is out! That should unblock this work. |
|
I'm going to make the Lines 518 to 551 in 41e1593 |
|
New example for the docs: output: demo.webm
url: https://shot-scraper.datasette.io/en/stable/
viewport:
width: 1280
height: 720
cursor: true
wait_for: "text=Quick start"
scenes:
- name: Documentation home
hold: 1
- name: Open installation docs
do:
- click: ".sidebar-tree a[href='installation.html']"
- wait_for: 'h1:has-text("Installation")'
- screenshot: installation.png
hold: 1
- name: Search the docs
do:
- click: "input.sidebar-search"
- type:
into: "input.sidebar-search"
text: "authentication"
delay: 25
- press:
selector: "input.sidebar-search"
key: Enter
- wait_for: "text=Search Results"
hold: 2Running this: uv run shot-scraper video example.yml --mp4Outputs: And here's that demo.mp4 |
output: demo.webm
url: https://shot-scraper.datasette.io/en/stable/
cursor: true
scenes:
- name: Click installation link
do:
- click: ".sidebar-tree a[href='installation.html']"
- wait_for: 'h1:has-text("Installation")'
hold: 1I don't like how scenes:
- name: Click installation link
do:
- click: ".sidebar-tree a[href='installation.html']"
- wait_for: 'h1:has-text("Installation")'
- pause: 1 |
Ditched 'hold: 1' in favour of '- pause: 1' Renamed delay to delay_ms since it's the only ms one Removed duplicate width: and viewport.width: LOTS of improvements to docs/video.md
|
Testing this by having Codex use it to record a video of a new Datasette feature - in current checkout of the
It wrote this: output: /tmp/datasette-bulk-insert-demo.webm
server:
- uv
- --directory
- /Users/simon/Dropbox/dev/datasette
- run
- datasette
- -p
- 6419
- --root
- --secret
- "1"
- /tmp/demo.db
url: http://127.0.0.1:6419/demo/tasks
viewport:
width: 1280
height: 720
cursor: true
wait_for: 'button[data-table-action="insert-row"]'
javascript: |
(() => {
let clipboardText = "";
Object.defineProperty(navigator, "clipboard", {
configurable: true,
get: () => ({
writeText: async (text) => {
clipboardText = String(text);
},
readText: async () => clipboardText,
}),
});
})();
scenes:
- name: Bulk insert existing table rows
do:
- pause: 0.8
- click: 'button[data-table-action="insert-row"]'
- wait_for: "#row-edit-dialog[open]"
- pause: 0.5
- click: ".row-edit-bulk-insert"
- wait_for: ".row-edit-bulk-textarea"
- pause: 0.5
- click: ".row-edit-copy-template"
- wait_for: "text=Copied"
- pause: 0.8
- fill:
into: ".row-edit-bulk-textarea"
text: |
title,owner,status,priority,notes
Prepare release video,Ana,doing,1,Recorded with shot-scraper
Check pasted CSV import,Ben,review,3,Previewed before inserting
Share the branch demo,Chen,queued,2,Bulk insert creates three rows
- pause: 0.8
- click: ".row-edit-save"
- wait_for: "text=Previewing 3 rows."
- pause: 1.2
- click: ".row-edit-save"
- wait_for: "text=3 rows inserted."
- pause: 1.0
- click: ".row-edit-cancel"
- wait_for: "text=Prepare release video"
- pause: 1.0
- name: Create a table from pasted CSV
open: http://127.0.0.1:6419/demo
wait_for: 'details.actions-menu-links summary'
do:
- pause: 0.8
- click: 'details.actions-menu-links summary'
- click: 'button[data-database-action="create-table"]'
- wait_for: "#table-create-dialog[open]"
- pause: 0.5
- fill:
into: ".table-create-table-name"
text: "launch_metrics"
- click: ".table-create-from-data"
- wait_for: ".table-create-data-textarea"
- pause: 0.5
- fill:
into: ".table-create-data-textarea"
text: |
metric_id,name,score,recorded_on
m001,Activation rate,87.5,2026-06-29
m002,Retention check,72.25,2026-06-30
m003,CSV import health,95,2026-07-01
- pause: 0.8
- click: ".table-create-save"
- wait_for: "text=Previewing 3 rows."
- pause: 1.2
- click: ".table-create-save"
- wait_for_url: "**/demo/launch_metrics"
- wait_for: "text=Activation rate"
- pause: 1.2Resulting in: datasette-bulk-insert-demo.mp4 |
|
This example which GPT-5.5 suggested illustrates a feature gap: output: demo.webm
server: mkdir -p /tmp/demo-root && python -m http.server 8000 --directory /tmp/demo-root
scenes:
- name: Home page
sh: echo "<h1>Local demo</h1>" > /tmp/demo-root/index.html
open: http://localhost:8000/
wait_for: h1
do:
- pause: 1The reason the |
|
To fix that I'm going to add |
|
Wrote this up here: https://simonwillison.net/2026/Jun/30/shot-scraper-video/ |
Refs:
📚 Documentation preview 📚: https://shot-scraper--194.org.readthedocs.build/en/194/