{
  "schemaVersion": "1.0",
  "item": {
    "slug": "my-play-music-from-yt",
    "name": "Play Music from YouTube",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/whodidthese/my-play-music-from-yt",
    "canonicalUrl": "https://clawhub.ai/whodidthese/my-play-music-from-yt",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/my-play-music-from-yt",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=my-play-music-from-yt",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "references/playwright-ref.md",
      "references/youtube-guide.md",
      "SKILL.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T16:55:25.780Z",
      "expiresAt": "2026-05-07T16:55:25.780Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=network",
        "contentDisposition": "attachment; filename=\"network-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/my-play-music-from-yt"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/my-play-music-from-yt",
    "agentPageUrl": "https://openagent3.xyz/skills/my-play-music-from-yt/agent",
    "manifestUrl": "https://openagent3.xyz/skills/my-play-music-from-yt/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/my-play-music-from-yt/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Play Music from YouTube — Clear, Stable, High SNR Instruction Set",
        "body": "This skill controls a visible browser using playwright-cli to search and play YouTube music.\nAll actions follow snapshot → ref → action pattern. Never guess. Never assume."
      },
      {
        "title": "1. Always use a named session",
        "body": "-s=music_player\n\nEvery command must include it."
      },
      {
        "title": "2. Always snapshot before interacting",
        "body": "playwright-cli -s=music_player snapshot\n\nNever click/fill without fresh refs."
      },
      {
        "title": "3. Only use ref-based actions",
        "body": "click e123\nfill e45 \"text\"\n\nNever use CSS, XPaths, or assumptions."
      },
      {
        "title": "4. Browser must be visible",
        "body": "--headed\n\nUse headed by default unless the user explicitly requests headless."
      },
      {
        "title": "5. Session continues in background",
        "body": "After playback begins, do not block waiting. Continue responding normally."
      },
      {
        "title": "6. Use persistent browser profile",
        "body": "--persistent\n\nAlways include --persistent when opening a new session. This saves the browser profile (cookies, localStorage, IndexedDB, cache) to disk, so login state survives session restarts."
      },
      {
        "title": "SNAPSHOT STORAGE",
        "body": "Snapshots generated by playwright-cli may exist in two possible locations:\n\n$WORKSPACE/.playwright-cli/ ← primary (search here first)\n~/.playwright-cli/ ← fallback when the workspace folder is empty\n\nUse only these two folders unless the user explicitly authorizes a broader search.\n\nIf no .yml snapshots appear here, it is almost always MacOS permission-related.\nAsk the user to run:\n\nplaywright-cli open https://www.youtube.com --headed\n\nThis will trigger macOS system dialogs for:\n\nScreen Recording\nAutomation\nAccessibility\n\nApprove all to enable snapshot generation.\n\nNote: On Windows and Linux, these permission dialogs do not apply. If snapshots are missing on those platforms, check that the browser launched correctly."
      },
      {
        "title": "Check whether the session exists",
        "body": "playwright-cli list\n\nExists → continue\nMissing → recreate:\n\nplaywright-cli -s=music_player open https://www.youtube.com --headed --persistent\n\nOn any unexpected error, run playwright-cli list first to diagnose before retrying."
      },
      {
        "title": "If the session is frozen or blank",
        "body": "playwright-cli -s=music_player goto https://www.youtube.com\n\nThis reliably resets the page without closing the session."
      },
      {
        "title": "SEARCH QUERY CONSTRUCTION",
        "body": "Build the search query based on user intent:\n\nIntentQuery patternExampleSpecific song[Artist] [Song Title]ABBA Money Money MoneyArtist playlist[Artist]周杰倫Genre / mood[descriptor] music playlistrelaxing spa music playlistEra-based[era] [language/genre] playlist華語 60年代 老歌 playlist\n\nSearch tips:\n\nFor artist requests, a simple artist name search usually surfaces \"Mix\" and playlist results at the top — prefer these for continuous playback.\nUse the original language for non-English songs (e.g. Chinese characters for Chinese songs).\n\nVoice transcription (ASR) and typo handling:\n\nDo NOT ask the user to confirm potentially misheard names. YouTube has robust auto-correction and will show results for the intended query even with typos or homophones (e.g. searching \"楊成林\" will auto-correct to \"楊丞琳\").\nAlways search directly with whatever text you have. After the search, check the results snapshot — if YouTube shows a \"Did you mean: ...\" or \"顯示以下搜尋結果: ...\" banner with corrected results, the correction is already applied.\nOnly fall back to web search or asking the user if the YouTube search results are clearly unrelated or empty."
      },
      {
        "title": "Step 1 — Reset search state",
        "body": "A clean search state avoids dropdown obstruction.\n\nPerform the following every time before a new search:\n\nSnapshot.\nIf button \"Clear search query\" / \"清除搜尋查詢\" is present → click it.\nElse press:\n\nplaywright-cli -s=music_player press Escape\n\nIf suggestions or overlays still block results → reset page:\n\nplaywright-cli -s=music_player goto https://www.youtube.com\n\nThen snapshot again."
      },
      {
        "title": "Step 2 — Locate search bar",
        "body": "Snapshot → find:\n\ncombobox \"搜尋\" or\ncombobox \"Search\"\n\nRecord its ref (e.g., e34)."
      },
      {
        "title": "Step 3 — Perform search",
        "body": "playwright-cli -s=music_player fill <searchRef> \"SEARCH TERM\"\nplaywright-cli -s=music_player press Enter\n\nThen snapshot immediately to avoid suggestion-panel obstruction."
      },
      {
        "title": "Step 4 — Choose best result",
        "body": "Select result based on user intent:\n\nSpecific song → click the link whose heading matches the song title.\nArtist → prefer \"Mix - [Artist]\" links or playlist links for continuous playback.\nGenre / mood → prefer long-duration compilations or playlists (>20 mins).\nFallback if no clear match → prefer: Mix > Long playlist > Official channel upload > Single MV.\n\nFor guidance on identifying YouTube result types, see ./references/youtube-guide.md.\n\nImportant: Do NOT click channel cards (e.g. link \"Artist Name ... @handle•NNNK subscribers ...\" / \"Artist Name ... @handle•NNN萬位訂閱者 ...\"). They navigate to the channel page, not music. Look for Mix or playlist results below them.\n\nClick using its ref:\n\nplaywright-cli -s=music_player click eXYZ\n\nIf click is blocked:\n\npress Escape\nRetry click once.\nIf still blocked → goto https://www.youtube.com and restart from Step 1."
      },
      {
        "title": "AD HANDLING LOOP",
        "body": "After clicking a result:\n\nplaywright-cli -s=music_player snapshot\n\nLoop up to 4 iterations:"
      },
      {
        "title": "1. Playback detected",
        "body": "If you see:\n\nbutton \"Pause (k)\" or\nbutton \"Play (k)\" (but video advancing)\n\nAND no ad indicators → playback is active → report song title to the user."
      },
      {
        "title": "2. Skip button detected",
        "body": "Any element whose label contains:\n\nskip / Skip / 略過\nSkip Ad / Skip Ads / 略過廣告\n\n→ click it immediately.\n\nNote: If the skip button is [disabled] (countdown not yet elapsed), do NOT click it — wait ~5 seconds instead (see step 3).\n\nThen snapshot again. YouTube often plays two consecutive ads — always check for a second ad after skipping."
      },
      {
        "title": "3. Non-skippable ad / countdown",
        "body": "Wait 5 seconds:\n\nplaywright-cli -s=music_player eval \"await new Promise(r=>setTimeout(r,5000))\"\n\nThen snapshot again and repeat from step 1."
      },
      {
        "title": "If ads persist >20 seconds",
        "body": "press Escape\nor reload page"
      },
      {
        "title": "PLAYBACK CONTROLS",
        "body": "Always snapshot first.\n\nCommandActionPauseclick button \"Pause (k)\"Resume / Playclick button \"Play (k)\"Nextpress Shift+nPreviouspress Shift+pChange songStart new search from Step 1Stopplaywright-cli -s=music_player close\n\nKeyboard shortcuts (reliable alternative when button refs are hard to locate):\n\nk        → play / pause\nShift+n  → next track\nShift+p  → previous track\nm        → mute / unmute\nf        → fullscreen toggle\nj        → rewind 10s\nl        → forward 10s\n\nUsage: playwright-cli -s=music_player press <key>"
      },
      {
        "title": "If snapshot empty or missing critical refs",
        "body": "playwright-cli -s=music_player goto https://www.youtube.com\n\n→ restart from Step 1."
      },
      {
        "title": "If browser crashes or session disappears",
        "body": "playwright-cli list shows no music_player.\nInform the user the browser was closed, then recreate session:\n\nplaywright-cli -s=music_player open https://www.youtube.com --headed --persistent\n\nBecause --persistent is used, the browser profile (including login state) is restored automatically. No need to log in again."
      },
      {
        "title": "YouTube cookie consent / sign-in dialogs",
        "body": "Snapshot → locate dismiss actions:\n\n\"Accept all\" / \"全部接受\"\n\"Reject all\"\n\"No thanks\" / \"不用了，謝謝\"\nClose (X)\n\nClick dismiss."
      },
      {
        "title": "YouTube Premium trial popup",
        "body": "Snapshot → look for \"No thanks\", \"不用了，謝謝\", or a dismiss/close button → click to dismiss."
      },
      {
        "title": "Video unavailable",
        "body": "Snapshot shows \"Video unavailable\" or similar error.\n\nplaywright-cli -s=music_player go-back → snapshot → try the next result link."
      },
      {
        "title": "Cannot find elements in search results",
        "body": "Scroll down: playwright-cli -s=music_player press PageDown → snapshot again."
      },
      {
        "title": "Page frozen or blank",
        "body": "playwright-cli -s=music_player reload → snapshot.\nIf still broken: playwright-cli -s=music_player close → reopen and retry from Step 1."
      },
      {
        "title": "Persistent profile corrupted or login expired",
        "body": "If the browser opens but login state is lost, or YouTube forces re-authentication:\n\nInform the user they need to log in again in the browser.\nAfter login, the persistent profile will be updated automatically.\n\nTo completely reset the profile (last resort):\n\nplaywright-cli -s=music_player close\nplaywright-cli -s=music_player delete-data\nplaywright-cli -s=music_player open https://www.youtube.com --headed --persistent"
      },
      {
        "title": "REFERENCES",
        "body": "Playwright CLI reference\nYouTube result identification"
      }
    ],
    "body": "Play Music from YouTube — Clear, Stable, High SNR Instruction Set\n\nThis skill controls a visible browser using playwright-cli to search and play YouTube music. All actions follow snapshot → ref → action pattern. Never guess. Never assume.\n\nCORE PRINCIPLES\n1. Always use a named session\n-s=music_player\n\n\nEvery command must include it.\n\n2. Always snapshot before interacting\nplaywright-cli -s=music_player snapshot\n\n\nNever click/fill without fresh refs.\n\n3. Only use ref-based actions\nclick e123\nfill e45 \"text\"\n\n\nNever use CSS, XPaths, or assumptions.\n\n4. Browser must be visible\n--headed\n\n\nUse headed by default unless the user explicitly requests headless.\n\n5. Session continues in background\n\nAfter playback begins, do not block waiting. Continue responding normally.\n\n6. Use persistent browser profile\n--persistent\n\n\nAlways include --persistent when opening a new session. This saves the browser profile (cookies, localStorage, IndexedDB, cache) to disk, so login state survives session restarts.\n\nSNAPSHOT STORAGE\n\nSnapshots generated by playwright-cli may exist in two possible locations:\n\n$WORKSPACE/.playwright-cli/ ← primary (search here first)\n~/.playwright-cli/ ← fallback when the workspace folder is empty\n\nUse only these two folders unless the user explicitly authorizes a broader search.\n\nIf no .yml snapshots appear here, it is almost always MacOS permission-related. Ask the user to run:\n\nplaywright-cli open https://www.youtube.com --headed\n\n\nThis will trigger macOS system dialogs for:\n\nScreen Recording\nAutomation\nAccessibility\n\nApprove all to enable snapshot generation.\n\nNote: On Windows and Linux, these permission dialogs do not apply. If snapshots are missing on those platforms, check that the browser launched correctly.\n\nSESSION MANAGEMENT\nCheck whether the session exists\nplaywright-cli list\n\nExists → continue\nMissing → recreate:\nplaywright-cli -s=music_player open https://www.youtube.com --headed --persistent\n\n\nOn any unexpected error, run playwright-cli list first to diagnose before retrying.\n\nIf the session is frozen or blank\nplaywright-cli -s=music_player goto https://www.youtube.com\n\n\nThis reliably resets the page without closing the session.\n\nSEARCH QUERY CONSTRUCTION\n\nBuild the search query based on user intent:\n\nIntent\tQuery pattern\tExample\nSpecific song\t[Artist] [Song Title]\tABBA Money Money Money\nArtist playlist\t[Artist]\t周杰倫\nGenre / mood\t[descriptor] music playlist\trelaxing spa music playlist\nEra-based\t[era] [language/genre] playlist\t華語 60年代 老歌 playlist\n\nSearch tips:\n\nFor artist requests, a simple artist name search usually surfaces \"Mix\" and playlist results at the top — prefer these for continuous playback.\nUse the original language for non-English songs (e.g. Chinese characters for Chinese songs).\n\nVoice transcription (ASR) and typo handling:\n\nDo NOT ask the user to confirm potentially misheard names. YouTube has robust auto-correction and will show results for the intended query even with typos or homophones (e.g. searching \"楊成林\" will auto-correct to \"楊丞琳\").\nAlways search directly with whatever text you have. After the search, check the results snapshot — if YouTube shows a \"Did you mean: ...\" or \"顯示以下搜尋結果: ...\" banner with corrected results, the correction is already applied.\nOnly fall back to web search or asking the user if the YouTube search results are clearly unrelated or empty.\nSEARCH WORKFLOW (HIGH SIGNAL, LOW AMBIGUITY)\nStep 1 — Reset search state\n\nA clean search state avoids dropdown obstruction.\n\nPerform the following every time before a new search:\n\nSnapshot.\nIf button \"Clear search query\" / \"清除搜尋查詢\" is present → click it.\nElse press:\nplaywright-cli -s=music_player press Escape\n\nIf suggestions or overlays still block results → reset page:\nplaywright-cli -s=music_player goto https://www.youtube.com\n\n\nThen snapshot again.\n\nStep 2 — Locate search bar\n\nSnapshot → find:\n\ncombobox \"搜尋\" or\ncombobox \"Search\"\n\nRecord its ref (e.g., e34).\n\nStep 3 — Perform search\nplaywright-cli -s=music_player fill <searchRef> \"SEARCH TERM\"\nplaywright-cli -s=music_player press Enter\n\n\nThen snapshot immediately to avoid suggestion-panel obstruction.\n\nStep 4 — Choose best result\n\nSelect result based on user intent:\n\nSpecific song → click the link whose heading matches the song title.\nArtist → prefer \"Mix - [Artist]\" links or playlist links for continuous playback.\nGenre / mood → prefer long-duration compilations or playlists (>20 mins).\nFallback if no clear match → prefer: Mix > Long playlist > Official channel upload > Single MV.\n\nFor guidance on identifying YouTube result types, see ./references/youtube-guide.md.\n\nImportant: Do NOT click channel cards (e.g. link \"Artist Name ... @handle•NNNK subscribers ...\" / \"Artist Name ... @handle•NNN萬位訂閱者 ...\"). They navigate to the channel page, not music. Look for Mix or playlist results below them.\n\nClick using its ref:\n\nplaywright-cli -s=music_player click eXYZ\n\n\nIf click is blocked:\n\npress Escape\nRetry click once.\nIf still blocked → goto https://www.youtube.com and restart from Step 1.\nAD HANDLING LOOP\n\nAfter clicking a result:\n\nplaywright-cli -s=music_player snapshot\n\n\nLoop up to 4 iterations:\n\n1. Playback detected\n\nIf you see:\n\nbutton \"Pause (k)\" or\nbutton \"Play (k)\" (but video advancing)\n\nAND no ad indicators → playback is active → report song title to the user.\n\n2. Skip button detected\n\nAny element whose label contains:\n\nskip / Skip / 略過\nSkip Ad / Skip Ads / 略過廣告\n\n→ click it immediately.\n\nNote: If the skip button is [disabled] (countdown not yet elapsed), do NOT click it — wait ~5 seconds instead (see step 3).\n\nThen snapshot again. YouTube often plays two consecutive ads — always check for a second ad after skipping.\n\n3. Non-skippable ad / countdown\n\nWait 5 seconds:\n\nplaywright-cli -s=music_player eval \"await new Promise(r=>setTimeout(r,5000))\"\n\n\nThen snapshot again and repeat from step 1.\n\nIf ads persist >20 seconds\npress Escape\nor reload page\nPLAYBACK CONTROLS\n\nAlways snapshot first.\n\nCommand\tAction\nPause\tclick button \"Pause (k)\"\nResume / Play\tclick button \"Play (k)\"\nNext\tpress Shift+n\nPrevious\tpress Shift+p\nChange song\tStart new search from Step 1\nStop\tplaywright-cli -s=music_player close\n\nKeyboard shortcuts (reliable alternative when button refs are hard to locate):\n\nk        → play / pause\nShift+n  → next track\nShift+p  → previous track\nm        → mute / unmute\nf        → fullscreen toggle\nj        → rewind 10s\nl        → forward 10s\n\n\nUsage: playwright-cli -s=music_player press <key>\n\nERROR RECOVERY & EDGE CASES\nIf snapshot empty or missing critical refs\nplaywright-cli -s=music_player goto https://www.youtube.com\n\n\n→ restart from Step 1.\n\nIf browser crashes or session disappears\n\nplaywright-cli list shows no music_player. Inform the user the browser was closed, then recreate session:\n\nplaywright-cli -s=music_player open https://www.youtube.com --headed --persistent\n\n\nBecause --persistent is used, the browser profile (including login state) is restored automatically. No need to log in again.\n\nYouTube cookie consent / sign-in dialogs\n\nSnapshot → locate dismiss actions:\n\n\"Accept all\" / \"全部接受\"\n\"Reject all\"\n\"No thanks\" / \"不用了，謝謝\"\nClose (X)\n\nClick dismiss.\n\nYouTube Premium trial popup\n\nSnapshot → look for \"No thanks\", \"不用了，謝謝\", or a dismiss/close button → click to dismiss.\n\nVideo unavailable\n\nSnapshot shows \"Video unavailable\" or similar error.\n\nplaywright-cli -s=music_player go-back → snapshot → try the next result link.\nCannot find elements in search results\nScroll down: playwright-cli -s=music_player press PageDown → snapshot again.\nPage frozen or blank\nplaywright-cli -s=music_player reload → snapshot.\nIf still broken: playwright-cli -s=music_player close → reopen and retry from Step 1.\nPersistent profile corrupted or login expired\n\nIf the browser opens but login state is lost, or YouTube forces re-authentication:\n\nInform the user they need to log in again in the browser.\nAfter login, the persistent profile will be updated automatically.\n\nTo completely reset the profile (last resort):\n\nplaywright-cli -s=music_player close\nplaywright-cli -s=music_player delete-data\nplaywright-cli -s=music_player open https://www.youtube.com --headed --persistent\n\nREFERENCES\nPlaywright CLI reference\nYouTube result identification"
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/whodidthese/my-play-music-from-yt",
    "publisherUrl": "https://clawhub.ai/whodidthese/my-play-music-from-yt",
    "owner": "whodidthese",
    "version": "0.0.9",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/my-play-music-from-yt",
    "downloadUrl": "https://openagent3.xyz/downloads/my-play-music-from-yt",
    "agentUrl": "https://openagent3.xyz/skills/my-play-music-from-yt/agent",
    "manifestUrl": "https://openagent3.xyz/skills/my-play-music-from-yt/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/my-play-music-from-yt/agent.md"
  }
}