This uses modified code from takomst/spotilink to work directly with Erela.JS as a plugin.
This a plugin for Erela.JS to allow the use of Spotify URL's, it uses direct URL's being tracks, albums, and playlists.
- https://open.spotify.com/track/4uLU6hMCjMI75M1A2tKUQC
- https://open.spotify.com/album/6N9PS4QXF1D0OWPk0Sxtb4
- https://open.spotify.com/playlist/37i9dQZF1DZ06evO05tE88
It is recommended to read the documentation to start, and the guides to use the plugin.
- Spotify App for the clientID & clientSecret
NPM :
npm install erela.js-spotify
Yarn :
yarn add erela.js-spotify
This assumes you already have Erela.JS setup. Refer to the guides to start.
This is also part of the code, it only shows using the plugin.
const { Manager } = require("erela.js");
const Spotify = require("erela.js-spotify");
const clientID = ""; // clientID from your Spotify app
const clientSecret = ""; // clientSecret from your Spotify app
const manager = new Manager({
plugins: [ new Spotify({ clientID, clientSecret }) ]
});
manager.search("https://open.spotify.com/track/4uLU6hMCjMI75M1A2tKUQC");