| name | youtube |
| description | YouTube search and playback control via Playwright |
| triggers | ["youtube","watch","video","play video","search youtube"] |
| url | https://www.youtube.com |
YouTube
What it does
Searches YouTube and controls video playback via Playwright.
Use when
- User says "search YouTube for [query]"
- User says "play [video] on YouTube"
- User says "pause/skip/volume" while YouTube is active
Security
- Only ever navigate to
https://www.youtube.com
- Never extract or log session cookies or auth tokens
- Never click on ads or sponsored content programmatically
CRITICAL — autoplay bug
NEVER use keyboard_press(key="Enter") to start a video after search. YouTube does not auto-focus the first result. Always click the thumbnail directly.
How to search and play a video
playwright_focus_tab(url_contains="youtube") — try existing tab
- If no tab →
playwright_open_url(url="https://www.youtube.com")
playwright_click(selector="input#search") — focus search box
playwright_type(selector="input#search", text="<query>") — type query
keyboard_press(key="Enter") — submit search
playwright_wait_for(selector="ytd-video-renderer", timeout_ms=5000) — wait for results
playwright_click(selector="ytd-video-renderer #thumbnail") — click first video thumbnail
Playback controls (once video is playing)
- Play/pause:
keyboard_press(key="k") — YouTube's native shortcut
- Volume up:
keyboard_press(key="up")
- Volume down:
keyboard_press(key="down")
- Skip ad:
playwright_click(selector=".ytp-skip-ad-button", strategy="auto")
Primitives used
playwright_focus_tab(url_contains) — switch to YouTube tab
playwright_open_url(url) — open YouTube
playwright_click(selector, strategy) — click elements
playwright_type(selector, text) — type search query
playwright_wait_for(selector, timeout_ms) — wait for results
keyboard_press(key) — playback shortcuts ("k", "up", "down")