Giter Site home page Giter Site logo

disrupt's Introduction

Disrupt

An experimental music library that can play back audio to discord.js bots.

Supported Sources

Disrupt currently supports:

  • Deezer (native)
  • SoundCloud (native)
  • Bandcamp (native)
  • Spotify (only metadata is fetched from Spotify, audio comes from Deezer)
  • HTTP streams
  • Apple Music (via Deezer)

Sources that are coming:

  • Pandora Music

Installation

Currently, there are no prebuilt versions of this library neither here nor on NPM as the library isn't ready yet. However, if you want to experiment with Disrupt, clone this repo and run "(p)npm build" to build and deploy the library locally. A prebuilt version will be offered via NPM once the library is finished.

Credits

This library is heavily inspired by LavaSrc. If you want to use Lavalink instead of this, I highly recommend installing this plugin. Alongside this, huge thanks go to the many Deezer related projects that helped me understand Deezer's encryption algorithm and how their private API works.

This project uses the Blowfish library from egoroof which was adapted and modified for use in this project (transformed from ESM only into ESM + CJS for compatibility). The used library is licensed under the MIT License and the original (untouched) license of it can be viewed here.

disrupt's People

Contributors

notscrappie avatar renovate[bot] avatar

disrupt's Issues

feat: volume editing

Volume editing is currently supported since inlineVolume is set to true in the audio resource creation process. However, functions need to be implemented in order to edit the volume.

refactor: clean up manager resolving (+ other stuff)

Full Manager Cleanup (+ other)

In preparation for the upcoming beta of Disrupt, the Manager definitely needs to be cleaned up.

This starts with removing the regexes and the if statement squid in the resolve function and finding an alternate way that's more optimized. Most likely by splitting the query and using a switch statement.

Another thing is also entirely refactoring how the ResolveResponse interface works so the user doesn't need to type res.info when using TypeScript.

(leaving this as a note for myself)

Disrupt | Progress Tracker

What is Disrupt?

Disrupt is an extremely experimental library used to stream audio from streaming services like Deezer, SoundCloud, Spotify and others. What differentiates Disrupt from the rest is the fact that it relies solely on Deezer as the "default" platform that it streams audio from with full native playback support (no searching on YouTube and playing the equivalent) and the custom solution that we've built with the help of other repositories who have documented the private APIs of Deezer.

This library is currently extremely experimental and a lot of things need to be implemented, so that's why I've created this issue in order to track the progress.

To Do List

  • Remove the hardcoded track decryption key so that I don't get into legal trouble with Deezer or risk getting DMCA'd.
  • Better understand the @discordjs/voice package and create a Player system using it.
  • Create a full queue system.
  • Create a full Track system in order to pull information about the currently playing track (title, artist, ID etc).
  • Implement player events (such as trackStart, trackEnd and trackError).
  • Implement album support.
  • Implement playlist support.
  • Add native support for SoundCloud.
  • Add support for Spotify with searching via Deezer.
  • Add volume editing support.
  • Enhance the requester system.
  • Add seeking.
  • Add compatibility with musicard.

Personal Notes

  • ARLs are passed under a Cookie header during the first request that you send to the Deezer API (deezer.ping).
  • Bandcamp doesn't have an API for generating song links, they instead store the link to the MP3 in an audio tag in the song's HTML page.
  • SoundCloud requires a client ID (probably gonna make the user provide their own) and does have a public API for getting stream URLs, gonna need to leave credit though. Found an alternate way, will need to document.
  • Deezer CheckForm token (API token) doesn't seem to reset itself if you previously pinged the endpoint, will most likely need to find a way to reset the cookie that controls this before pinging again with the URL in the cookie field.
  • For loops don't really work for albums or playlists. Mostly causes memory leaks, need to find an alternate way of fetching albums without performance going to shit. Fixed this by implementing stream URL fetching upon the track entering a now playing state.
  • Will need to split off checkForm (API key) fetching into its own function that assigns the token to a variable inside the Deezer Manager. Most likely gonna make this an "init()" function that needs to be added to the bot's ready event file. Should speed up media URL fetching & song data fetching quite a bit since no more unnecessary requests are being done. Added a check to the fetchMediaURL() function instead that will run if the sid or licenseToken aren't defined.
  • Bandcamp stores their album / song information in a script element in their HTML instead of fetching from an API. Info is under a script with the type of application/ld+json.

This list might grow so, keep an eye out!

feat: seeking

Will need to create a custom createSeekableAudioSource function in order to enable seeking support since d.js voice removed this built-in feature.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

npm
package.json
  • @discordjs/voice ^0.16.1
  • axios ^1.6.1
  • ffmpeg-static ^5.2.0
  • libsodium-wrappers ^0.7.13
  • m3u8stream ^0.8.6
  • prism-media ^1.3.5
  • @types/node ^20.9.0
  • @typescript-eslint/eslint-plugin ^6.11.0
  • @typescript-eslint/parser ^6.11.0
  • eslint ^8.53.0
  • terser ^5.24.0
  • tsup ^7.2.0
  • typescript ^5.2.2

  • Check this box to trigger a request for Renovate to run again on this repository

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.