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