ytmusic-hub

Read and write YouTube Music data using Python and ytmusicapi with cookie-based authentication.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Accessing YouTube Music data programmatically requires authenticated API calls, and manually copying browser cookies is tedious and error-prone. This Skill automates the full authentication flow and provides ready-made scripts for playlist management, search, and recommendations. ## Core Features & Use Cases - Automated Authentication: Obtain cookies via browser_use get_cookies and generate a ytmusicapi browser-auth file with SAPISIDHASH automatically, no manual copying. - Full Playlist Management: List, create, edit, delete playlists, add or remove tracks, read liked songs, and export playlists as Markdown. - Recommendation Playlists: Generate recommendation playlists from your liked songs or from a cold-start seed artist (e.g., Jay Chou style) with deduplication and per-artist caps. - Use Case: Ask to export one of your YouTube Music playlists as a Markdown file, or create a new playlist of songs similar to your liked tracks, and the Skill handles auth, search, and playlist creation end to end. ## Quick Start Ask the assistant to list your YouTube Music playlists, and it will verify authentication and print them with their IDs.

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. Once authenticated, call get_library_playlists to list playlists and get_playlist to read full track lists.

How to authenticate ytmusicapi without manually copying cookies?

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.

Why does ytmusicapi fail with SSL or connection errors?

Some environments have broken SSL certificate verification or DNS pollution for youtube.com domains. The ytmusic_client module disables certificate verification in urllib3 and resolves the real IP via Google DNS-over-HTTPS when local DNS fails.

How do I remove a song from a YouTube Music playlist?

Use remove_playlist_items with the track's setVideoId, not its videoId. The setVideoId is the track's position-specific identifier within that playlist, obtained from get_playlist results.

How long do YouTube Music cookies last before re-authentication?

Cookies typically remain valid for days to weeks. When they expire, re-run the browser_use get_cookies flow and setup_auth.py, then verify with test_auth.py which checks that playlists can be read.