{"skill":{"slug":"ytmusic","displayName":"YouTube Music","summary":"Manage YouTube Music library, playlists, and discovery via ytmusicapi.","description":"---\nname: ytmusic-librarian\ndescription: Manage YouTube Music library, playlists, and discovery via ytmusicapi.\n---\n\n# YTMusic Librarian\n\nThis skill uses the `ytmusicapi` Python library to interact with YouTube Music.\n\n## Prerequisites\n\n- Python 3.x\n- `ytmusicapi` package: `pip install ytmusicapi`\n- Authentication file (`oauth.json` or `browser.json`) in the skill folder.\n\n## Setup Instructions\n\n1. **Install the library:**\n   ```bash\n   pip install ytmusicapi\n   ```\n\n2. **Generate Authentication (The \"cURL Handshake\"):**\n   - Open **Microsoft Edge** and visit [music.youtube.com](https://music.youtube.com) (ensure you are logged in).\n   - Press `F12` to open DevTools, go to the **Network** tab.\n   - Click your **Profile Icon -> Library** on the page.\n   - Look for a request named `browse` in the network list.\n   - **Right-click** the `browse` request -> **Copy -> Copy as cURL (bash)**.\n   - Paste that cURL command into a file named `headers.txt` in the skill folder.\n   - Run the following Python snippet to generate `browser.json`:\n     ```python\n     from ytmusicapi.auth.browser import setup_browser\n     with open('headers.txt', 'r') as f:\n         setup_browser('browser.json', f.read())\n     ```\n   - Ensure `browser.json` is located in the skill folder.\n\n3. **Verify:**\n   ```bash\n   python -c \"from ytmusicapi import YTMusic; yt = YTMusic('browser.json'); print(yt.get_library_songs(limit=1))\"\n   ```\n\n## Workflows\n\n### Library Management\n- List songs/albums: `yt.get_library_songs()`, `yt.get_library_albums()`\n- Add/Remove: `yt.rate_song(videoId, 'LIKE')`, `yt.edit_song_library_status(feedbackToken)`\n\n### Playlist Management\n- Create: `yt.create_playlist(title, description)`\n- Add Tracks: `yt.add_playlist_items(playlistId, [videoIds])`\n- Remove Tracks: `yt.remove_playlist_items(playlistId, [videoIds])`\n\n### Metadata & Discovery\n- Get Lyrics: `yt.get_lyrics(browseId)`\n- Get Related: `yt.get_watch_playlist(videoId)` -> `related`\n","tags":{"latest":"1.0.1"},"stats":{"comments":0,"downloads":2721,"installsAllTime":2,"installsCurrent":2,"stars":5,"versions":2},"createdAt":1769451656815,"updatedAt":1778485857338},"latestVersion":{"version":"1.0.1","createdAt":1769451932469,"changelog":"Changed display name.","license":null},"metadata":null,"owner":{"handle":"gentrycopsy","userId":"s174bahxq62wv2kpyxepz08aex885s75","displayName":"gentrycopsy","image":"https://avatars.githubusercontent.com/u/45244829?v=4"},"moderation":null}