@distube/soundcloud
TypeScript icon, indicating that this package has built-in type declarations

1.3.3 • Public • Published

npm peer dependency version npm GitHub Repo stars Discord

@distube/soundcloud

SoundCloud extractor plugin for DisTube.js.org.

Feature

  • Using SoundCloud API
  • Support SoundCloud tracks, albums and playlists
  • Search on SoundCloud
  • Faster than youtube-dl extractor

Installation

npm install @distube/soundcloud@latest

Usage

Plugin

const Discord = require("discord.js");
const client = new Discord.Client();

const { DisTube } = require("distube");
const { SoundCloudPlugin } = require("@distube/soundcloud");
const distube = new DisTube(client, {
  plugins: [new SoundCloudPlugin()],
});

Search

const { SoundCloudPlugin } = require("@distube/soundcloud");
SoundCloudPlugin.search("A SoundCloud Track"); // static method
// Returns an array of 10 DisTube's Songs

const scPlugin = new SoundCloudPlugin();
scPlugin.search("A SoundCloud Playlist", "playlist", 3); // class method
// Returns an array of 3 DisTube's Playlist

Documentation

new SoundCloudPlugin([SoundCloudPluginOptions])

  • SoundCloudPluginOptions.clientId [string] (optional): Your account's client id.
  • SoundCloudPluginOptions.oauthToken [string] (optional): Your account's oauth token. Used to fetch more data with SoundCloud Go+ account.
  • How to get clientId and oauthToken? See here

Example

new SoundCloudPlugin({
  clientId: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  oauthToken: "0-000000-000000000-xxxxxxxxxxxxxx",
});

SoundCloudPlugin.search(query, [type], [limit]) (Both static and class method)

Searches for the given query on SoundCloud.

  • Parameters

    • query [string] Search query.
    • type [string]: Type of results (track or playlist). Default is track.
    • limit [integer]: Limit the results. Default is 10.
  • Returns a Promise<Song[]|Playlist[]>

    • Returns a Promise<Song[]> if type parameter is track
    • Returns a Promise<Playlist[]> if type parameter is playlist

Package Sidebar

Install

npm i @distube/soundcloud

Weekly Downloads

2,571

Version

1.3.3

License

MIT

Unpacked Size

28.1 kB

Total Files

6

Last publish

Collaborators

  • skick