The YouTube Source Plugin: Why YouTube Left Lavalink Core
Why Lavalink v4 moved YouTube into a separate plugin, how to install and configure it, the errors you'll meet, and how to keep YouTube playback working.
On this page
If you’ve upgraded to Lavalink v4 or followed a recent setup guide, you’ve seen the instruction to set youtube: false in your sources and add a plugin instead. It looks backwards — turn off YouTube to get YouTube? This article explains why the change happened, how to set up the plugin, and how to deal with the errors YouTube playback throws.
Why YouTube moved out of core
Lavalink’s audio engine is built on Lavaplayer, which historically included a YouTube source. YouTube changes how it serves media frequently — cipher changes, new client requirements, anti-bot checks — and each change can break playback until the code is updated.
Tying YouTube fixes to Lavaplayer and Lavalink releases meant slow turnarounds and large, risky updates for a problem that often needed a small, quick fix. So the Lavalink developers created a dedicated YouTube source plugin (lavalink-devs/youtube-source) with its own release cycle. When YouTube changes something, the plugin can ship a fix without a new Lavalink release. The old built-in source is deprecated and no longer maintained.
The practical upshot: YouTube support now lives in the plugin, and keeping it updated is part of running a node.
Installing the plugin
In application.yml, disable the built-in source and add the plugin:
lavalink:
plugins:
- dependency: "dev.lavalink.youtube:youtube-plugin:VERSION"
snapshot: false
server:
sources:
youtube: false # built-in source off — the plugin replaces it
plugins:
youtube:
enabled: true
allowSearch: true
allowDirectVideoIds: true
allowDirectPlaylistIds: true
clients:
- MUSIC
- WEB
- WEBEMBEDDED
Replace VERSION with the latest release from the plugin’s GitHub page. Restart Lavalink; it downloads the plugin into the plugins folder.
Leaving the built-in source enabled alongside the plugin causes conflicts, so make sure sources.youtube is false.
Clients: what that list means
YouTube serves different apps — the website, the mobile apps, YouTube Music, embedded players, TV apps — through different internal “clients”, each with its own capabilities and restrictions. The plugin can request media as several of them and falls back through the list in order when one fails.
Which clients work best changes over time as YouTube adjusts each one. The plugin’s README keeps a current recommendation; treat any list in a tutorial (including the one above) as an example, and check the README when you update. Common settings:
clients— the ordered list of clients to try.allowSearch— enablesytsearch:andytmsearch:(YouTube Music) searches.allowDirectVideoIds/allowDirectPlaylistIds— accept bare IDs as well as full URLs.
Some setups also use advanced options described in the README, such as signing in with an OAuth token or supplying proof-of-origin tokens, to get past stricter checks. If you use sign-in options, use a secondary account rather than your personal one, and understand the risks the README describes.
Errors you’ll meet
YouTube playback failures show up as TrackExceptionEvents in your bot and as errors in the Lavalink log. The common ones:
“Sign in to confirm you’re not a bot” / “This video requires login” YouTube is challenging requests from your server’s IP. Datacenter IP ranges are more likely to be challenged. Updating the plugin and adjusting clients often helps; some operators use IPv6 rotation or the README’s advanced options.
“Please update” / cipher or signature errors YouTube changed something the plugin handles. Update the plugin — this is the most common fix of all.
403 Forbidden during playback The stream URL was rejected, often mid-track. Again, usually fixed by a plugin update or a different client order.
“Video unavailable” / region errors The video is genuinely blocked in the node’s region or removed. Nodes in a different region may play it.
Age-restricted videos These usually require sign-in and many setups can’t play them. Consider whether your bot should play them at all.
Keeping YouTube working
Because YouTube changes without warning, treat the plugin like a dependency that needs regular attention:
- Watch the plugin’s releases. Subscribe to release notifications on GitHub.
- Update promptly when YouTube playback breaks — bump the version in
application.ymland restart Lavalink. - Keep Lavalink itself current, since plugins target recent Lavalink versions.
- Log track exceptions in your bot with the error message, so you notice breakage from your own logs rather than user complaints.
- Have fallbacks. SoundCloud and other sources remain available; LavaSrc can mirror Spotify tracks to other providers if YouTube is having a bad day. See LavaSrc explained.
This ongoing maintenance is one of the strongest arguments for managed Lavalink. On Kerit Cloud’s managed plans, keeping plugins current is handled for you; on self-managed plans, you control the versions and the timing. Managed vs self-managed Lavalink weighs the two.
Migrating from the built-in source
If you’re moving a v3 or early-v4 node to the plugin:
- Update Lavalink to the latest v4 release.
- Set
lavalink.server.sources.youtube: false. - Add the plugin dependency and a
plugins.youtubeblock. - Remove any old YouTube-specific settings that belonged to the built-in source.
- Restart and test with
curl -H "Authorization: <password>" "http://<node>:2333/v4/loadtracks?identifier=ytsearch:test".
Your bot code doesn’t change: ytsearch: queries and YouTube URLs work the same way through the plugin.
A note on terms
Streaming from YouTube through a bot sits in a grey area of YouTube’s terms of service, and responsibility for how a bot is used lies with its operator. Many bots offer SoundCloud and other sources alongside YouTube, and some have moved away from YouTube playback entirely. Decide deliberately what your bot supports.
Summary
YouTube moved out of Lavalink’s core into the dedicated YouTube source plugin so fixes can ship as quickly as YouTube changes. Disable the built-in source, add the plugin, choose clients from the plugin’s current recommendations, and treat updates as routine maintenance — most “sign in”, cipher and 403 errors are fixed by updating. Log track exceptions, keep fallback sources, and consider managed hosting if you’d rather not track YouTube’s changes yourself.