Issues with Spotify Support
Howdy! I’m currently working on giving my Discord bot the ability to play music from YouTube (and optionally Spotify). I think Moonlink.js is a solid option.
I’m new to all the Lavalink stuff. I’ve set everything up according to the docs and tested it with the YouTube source. Only a few tracks work, and while some tracks play correctly in the Lavalink console on my server, others always prompt me to log in or something.
Since I’m just getting started, I wanted to ask if there’s an example bot that has both Spotify and YouTube support working smoothly, with reliable YouTube playback and Spotify integration. I’ve got everything prepared on my end, but I’m really struggling with getting Spotify support to work.
I love the Project!
7 Replies
Hey, so there are basically two ways to add Spotify support. But just a heads up: Lavalink itself doesn’t stream directly from Spotify. What it does is more like a fallback — it fetches track info from Spotify, but when it comes to the actual stream, it looks for the same track on other sources. If no stream exists for that track, it mirrors it from somewhere else.
1. Moonlink’s built-in Spotify support: it uses the official Spotify API. In the options you’d set something like:
{ spotify: { clientId: "", clientSecret: "" } }
The thing is, this broke when the plugin system was introduced. I had a local fix for it but lost that patch, so I’ll need to redo it and commit the correction.
2. LavaSrc: if you configure it, Moonlink fully supports any kind of source you add to the server. The whole architecture was built with high abstraction in mind, so it can handle whatever format of info the server sends back. Even when plugins send data a bit differently, Moonlink can still work with it.
GitHub
GitHub - topi314/LavaSrc: A collection of additional Lavaplayer/Lav...
A collection of additional Lavaplayer/Lavalink Sources - topi314/LavaSrc
Okay, if I understand correctly, I can’t stream directly from Spotify. If I submit something, there is a search engine that tries to find a version on YouTube. In that case, I wouldn’t need Spotify support and would only want YouTube support. I’m currently figuring out how to add an account so that I can access every song/video on YouTube. At the moment, it’s not working very well.
Can't play music from YouTube?
Yea, Im going to taka a close look at the evening. Currently ist 5:26am 🥲
So thats the problem I have with lavalink rn

yeah, look at #talk