prakhar1114/ai_mime_marketplace/play-a-song-on-youtube

Claude Code and agent skill by prakhar1114/ai_mime_marketplace

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Play a requested song on YouTube via a browser tab and verify the watch-page <video> element is actually playing.

Install

npx vskill@latest install prakhar1114/ai_mime_marketplace/play-a-song-on-youtube

SKILL.md

Play a song on YouTube (browser-harness)

Opens YouTube search results directly via youtube.com/results?search_query=..., picks the top standard video result (skipping ads / Shorts / channel rows), navigates to its canonical watch URL, and verifies the <video> element is actively playing. Driven through browser-harness — no Spotlight, no Safari address-bar typing, no UI clicks on YouTube itself.

Inputs

JSON object passed via --inputs-json /path/to/inputs.json.

FieldTypeRequiredDescription
song_namestringyesSearch query entered into YouTube (song / video name).
json
{ "song_name": "numb linkin park" }

Run

bash
# default — uses inputs/inputs.example.json
./run.sh
# explicit inputs file
./run.sh /absolute/path/to/inputs.json

run.sh lives at the skill root and is a thin wrapper that reads song_name from the inputs JSON, exports it as SONG_NAME, and invokes:

bash
browser-harness -c "$(cat scripts/play_song_on_youtube.py)"

Behavior:

  1. Opens a new browser tab at https://www.youtube.com/results?search_query=<URL-encoded song_name>

and waits for the page to load. Skips Safari/Spotlight launch — the harness already has a controlled Chrome instance.

  1. Polls the DOM (up to ~7.5s) for the first ytd-video-renderer link —

this CSS selector intentionally excludes ad slots, Shorts shelves, and channel/playlist rows so the top standard video is selected.

  1. Extracts the 11-char video id from the ?v=... query param and

navigates to the canonical https://www.youtube.com/watch?v=<id> URL. Using the canonical URL strips any &list=RD... autoplay-mix params that would otherwise hijack subsequent navigation.

  1. Polls document.querySelector("video") for up to ~5s and confirms

playback: !paused && currentTime > 0 && readyState == 4. If autoplay was blocked, calls video.play() and clicks .ytp-play-button once between polls before giving up.

Outputs

Final state is printed to stdout by the script:

Top result video id: kXYiU_JCYtU
PLAYING: {'paused': False, 'currentTime': 5.6, 'readyState': 4}
{'url': 'https://www.youtube.com/watch?v=kXYiU_JCYtU', 'title': '... – Linkin Park - YouTube', ...}
playback_started=true

The final line is always playback_started=true or playback_started=false.

Exit codes

CodeMeaning
0A YouTube watch page is open and the <video> element is playing.
1No results found, no playable video, or playback did not start.

Fallback

The optimized plan declares fallback: ui_agent for this step. If ./run.sh exits non-zero, hand off to the UI agent (or a human) rather than retrying — repeating the same harness call will not change the outcome. Likely causes: YouTube is showing a consent / sign-in interstitial, the browser-harness Chrome isn't running, or the network is blocking the site.

Step-by-step recovery instructions for driving YouTube's UI manually are in `references/fallback_plan.md`.

ask_llm decision points

None. Result selection is deterministic (first ytd-video-renderer), and playback verification reads the live <video> element state — no stochastic judgment required.

Recovery notes

  • Top-result selector matters. ytd-video-renderer a#video-title is

the right selector. Don't relax it to a#video-title alone — that also matches Shorts and channel-upload rows, which either don't have a ?v= param or jump into the Shorts player (which doesn't expose a standard <video> element the verification step can read).

  • Strip `&list=RD...`. YouTube's "Mix - <song>" autoplay queue gets

attached to the first result's href. Navigating to that URL works, but any later programmatic navigation gets pulled back into the mix. Re-navigating to the canonical watch?v=<id> avoids this entirely.

  • Autoplay can be blocked. A fresh Chrome profile without prior user

interaction sometimes refuses to autoplay with sound. The verification loop self-heals by calling video.play() and clicking the play button between polls.

References

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/prakhar1114/ai_mime_marketplace/play-a-song-on-youtube/badge)](https://verified-skill.com/skills/prakhar1114/ai_mime_marketplace/play-a-song-on-youtube)

Something wrong with this skill or its page? Tell us.