ytmusic-hub

Manage YouTube Music playlists, liked songs, and search via ytmusicapi with cookie-based authentication.

Updated Jul 20, 2026
One-click install
npx skills add https://github.com/lsongdev/skills --skill ytmusic-hub-lsongdev
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ytmusic-hub
Source: https://github.com/lsongdev/skills/tree/main/ytmusic
Command: npx skills add https://github.com/lsongdev/skills --skill ytmusic-hub-lsongdev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires ytmusicapi, urllib3, and includes scripts (resource) components.

What problem does it solve? Accessing YouTube Music data programmatically requires authenticated API calls, but manual cookie copying and auth header generation is tedious and error-prone. This Skill automates the full authentication flow and provides ready-to-use scripts for reading and writing YouTube Music data. ## Core Features & Use Cases - Automated Authentication: Obtain cookies via browser_use get_cookies and generate a ytmusicapi browser-auth file with SAPISIDHASH, then verify it with a test script. - Playlist Management: List, create, edit, delete, and export playlists, plus search for songs and add or remove tracks. - Recommendation Playlists: Generate new playlists from your liked songs' style profile or from a cold-start seed artist like Jay Chou, with Markdown reports. - Use Case: Ask to export one of your YouTube Music playlists as a Markdown file, and the Skill reads the playlist via the API and writes a formatted track list with titles and artists. ## Quick Start Ask the assistant to list your YouTube Music playlists, and it will guide you through cookie-based authentication if needed before showing your playlists.

Frequently Asked Questions about ytmusic-hub

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I access my YouTube Music playlists with Python?▼

Use the ytmusicapi library with a browser-auth file generated from your YouTube Music cookies. After authentication, call get_library_playlists to list playlists and get_playlist to read full track lists.

How to authenticate ytmusicapi without copying cookies manually?▼

Navigate to music.youtube.com with browser_use, call get_cookies to export cookie environment variables, then run setup_auth.py. The script builds the cookie string and SAPISIDHASH authorization header and writes the auth file automatically.

Can I create a YouTube Music playlist from my liked songs?▼

Yes, the recommend_from_likes.py script reads your liked songs, identifies your top artists, searches for similar tracks, and creates a new private playlist with the results. It also writes a Markdown report of the recommendations.

Why does YouTube Music API access fail with SSL or DNS errors?▼

Some environments have DNS pollution or SSL certificate issues for youtube.com domains. The ytmusic_client module disables urllib3 certificate verification and resolves the real IP via Google DNS-over-HTTPS, patching socket.getaddrinfo automatically.

What is the difference between videoId and setVideoId in ytmusicapi?▼

videoId identifies a song globally on YouTube, while setVideoId identifies a track's position within a specific playlist. When removing tracks from a playlist, you must pass setVideoId, not videoId.

How long do YouTube Music cookies stay valid?▼

Cookies typically remain valid for days to weeks depending on session activity. When authentication fails, re-run the browser_use get_cookies flow and regenerate the auth file with setup_auth.py.