Giter VIP home page Giter VIP logo

soundcloud's Introduction

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

soundcloud's People

Contributors

lackypal avatar skick1234 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

soundcloud's Issues

Allow DisTube v4 As a Peer Dependency

Hi, I cannot use Discord.js v14 yet in production because you still have DisTube v3.1.0 as a peer dependency as seen below.

      "peerDependencies": {
        "distube": "^3.1.0"
      }

It would be great if you could allow for DisTube v4 to work with this plugin.

Further information:

  • Plugin version: 1.1.0
  • DisTube version: 4.0.0-dev.3
  • discord.js version: ^14.0.0-dev.1651147765-679dcda
  • Node.js version: 16.14

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.