Skip to main content

Lavalink API wrapper for discord audio playing

Project description

lavalink-rs

An API Wrapper for lavalink. Compatible with all tokio 1.x based discord crates or asyncio based discord python libraries.

If you have questions, you can get support in the serenity, lavalink or hikari discord servers, or by opening an issue in the gitlab repository.

Documentation for the library can be found here for rust or here for python.

To-Do

0.14

  • Implement __anext__ to QueueRef
  • Implement some const methods
  • RoutePlanner API
  • Support tokio-websockets
  • native and webpki roots for rustls feature separation

Future

  • Improve documentation with examples, better formatting, and fill in missing data
  • Expand event logging
  • discord.py example
  • hata example
  • twilight-rs example
  • Gitlab CI Tests
  • Implement abstractions for ease of use
  • Region based node selection method

Done

  • native_tls backend
  • Player queues
  • Readbale player queues
  • Search engine helpers
  • Write basic cocumentation
  • Songbird utilities
  • Serenity utilities
  • Twilight utilities
  • Load balancer node selection method
  • Lavasnek (PyO3)
  • Lavasnek events
  • Remove third party dependency for custom user data.
  • Round-Robin node selection method
  • Main and fallback node selection method
  • CPU Load based node selection method
  • Memory usage based node selection method
  • Custom node selection method
  • Python stubs
  • Basic Twilight 0.16 support
  • Hide password from logs
  • hikari-lightbulb example
  • Implement python builders for all the needed model structures
  • Expose Http and methods to python
  • Switch from reqwests to hyper
  • Implement SSL support with hyper
  • Implement search utilities to python
  • load_tracks to return Track in python
  • Streamable queue reader

Links to download stuff you will need

To install Lavalink, you can follow their getting started guide.

How to use

This is how you can install the library to be used.

Rust

You can install the latest version from crates.io:

lavalink-rs = "0.13"

# or

[dependencies.lavalink-rs]
version = "0.13"

Or the development release:

lavalink-rs = { git = "https://gitlab.com/vicky5124/lavalink-rs/", branch = "main"}

# or

[dependencies.lavalink-rs]
git = "https://gitlab.com/vicky5124/lavalink-rs/"
branch = "main"

If you wish to use a development version of songbird (or serenity, or twilight-model), add the following to the Cargo.toml:

[patch.crates-io.songbird]
git = "https://github.com/serenity-rs/songbird"
branch = "next"

[dependencies.songbird]
git = "https://github.com/serenity-rs/songbird"
branch = "next"

Python

You can install the latest version from pypi by using python3 -m pip install lavalink_rs.

OS Arch Python Versions Supported?
Windows x86 3.8-3.12
Windows x64 3.8-3.12
Windows aarch64 -
Mac OS x86_64 3.8-3.12
Mac OS aarch64 3.8-3.12
Linux x86 3.8-3.12
Linux x86_64 3.8-3.12
Linux armv7 3.8-3.12
Linux aarch64 3.8-3.12
Linux ppc64le -
Linux s390x -

Building the library

You can build the library using cargo build

To build for python, you can use maturin instead.

python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install maturin
maturin develop --target x86_64-unknown-linux-gnu

Features

  • macros: default feature - Adds procedural macros for ease of use.
  • rustls-native-roots: default feature - Use rustls with the system trusted roots.
  • rustls-webpki-roots: Use rustls with the Mozilla set of trusted roots.
  • native-tls Use the system native tls implementation.
  • serenity for serenity support.
  • songbird for songbird support.
  • twilight for twilight-model v0.15 support.
  • twilight16 for twilight-model v0.16-rc support.
  • python for python3.8+ support.

Contributing

To contribute to the project, fork the gitlab repository and create a merge request over there. Make sure to update the changelog with whatever update you did to the library.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lavalink_rs-0.13.0.tar.gz (646.2 kB view details)

Uploaded Source

Built Distributions

lavalink_rs-0.13.0-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux2014_i686.whl (3.2 MB view details)

Uploaded PyPy manylinux: glibc 2.17+ i686

lavalink_rs-0.13.0-pp310-pypy310_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (2.7 MB view details)

Uploaded PyPy manylinux: glibc 2.17+ ARMv7l

lavalink_rs-0.13.0-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl (3.2 MB view details)

Uploaded PyPy manylinux: glibc 2.17+ i686

lavalink_rs-0.13.0-pp39-pypy39_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (2.7 MB view details)

Uploaded PyPy manylinux: glibc 2.17+ ARMv7l

lavalink_rs-0.13.0-pp38-pypy38_pp73-manylinux_2_17_i686.manylinux2014_i686.whl (3.2 MB view details)

Uploaded PyPy manylinux: glibc 2.17+ i686

lavalink_rs-0.13.0-pp38-pypy38_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (2.7 MB view details)

Uploaded PyPy manylinux: glibc 2.17+ ARMv7l

lavalink_rs-0.13.0-cp312-none-win_amd64.whl (3.3 MB view details)

Uploaded CPython 3.12 Windows x86-64

lavalink_rs-0.13.0-cp312-none-win32.whl (2.7 MB view details)

Uploaded CPython 3.12 Windows x86

lavalink_rs-0.13.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

lavalink_rs-0.13.0-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl (3.2 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ i686

lavalink_rs-0.13.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (2.7 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARMv7l

lavalink_rs-0.13.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.0 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

lavalink_rs-0.13.0-cp312-cp312-macosx_11_0_arm64.whl (3.4 MB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

lavalink_rs-0.13.0-cp312-cp312-macosx_10_12_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.12 macOS 10.12+ x86-64

lavalink_rs-0.13.0-cp311-none-win_amd64.whl (3.3 MB view details)

Uploaded CPython 3.11 Windows x86-64

lavalink_rs-0.13.0-cp311-none-win32.whl (2.7 MB view details)

Uploaded CPython 3.11 Windows x86

lavalink_rs-0.13.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

lavalink_rs-0.13.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl (3.2 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ i686

lavalink_rs-0.13.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (2.7 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARMv7l

lavalink_rs-0.13.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.0 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

lavalink_rs-0.13.0-cp311-cp311-macosx_11_0_arm64.whl (3.4 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

lavalink_rs-0.13.0-cp311-cp311-macosx_10_12_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.11 macOS 10.12+ x86-64

lavalink_rs-0.13.0-cp310-none-win_amd64.whl (3.3 MB view details)

Uploaded CPython 3.10 Windows x86-64

lavalink_rs-0.13.0-cp310-none-win32.whl (2.7 MB view details)

Uploaded CPython 3.10 Windows x86

lavalink_rs-0.13.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

lavalink_rs-0.13.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (3.2 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ i686

lavalink_rs-0.13.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (2.7 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARMv7l

lavalink_rs-0.13.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.0 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

lavalink_rs-0.13.0-cp310-cp310-macosx_11_0_arm64.whl (3.4 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

lavalink_rs-0.13.0-cp310-cp310-macosx_10_12_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.10 macOS 10.12+ x86-64

lavalink_rs-0.13.0-cp39-none-win_amd64.whl (3.3 MB view details)

Uploaded CPython 3.9 Windows x86-64

lavalink_rs-0.13.0-cp39-none-win32.whl (2.7 MB view details)

Uploaded CPython 3.9 Windows x86

lavalink_rs-0.13.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

lavalink_rs-0.13.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl (3.2 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ i686

lavalink_rs-0.13.0-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (2.7 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARMv7l

lavalink_rs-0.13.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.0 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

lavalink_rs-0.13.0-cp39-cp39-macosx_11_0_arm64.whl (3.4 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

lavalink_rs-0.13.0-cp39-cp39-macosx_10_12_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.9 macOS 10.12+ x86-64

lavalink_rs-0.13.0-cp38-none-win_amd64.whl (3.3 MB view details)

Uploaded CPython 3.8 Windows x86-64

lavalink_rs-0.13.0-cp38-none-win32.whl (2.7 MB view details)

Uploaded CPython 3.8 Windows x86

lavalink_rs-0.13.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

lavalink_rs-0.13.0-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl (3.2 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ i686

lavalink_rs-0.13.0-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (2.7 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARMv7l

lavalink_rs-0.13.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.0 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

lavalink_rs-0.13.0-cp38-cp38-macosx_11_0_arm64.whl (3.4 MB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

lavalink_rs-0.13.0-cp38-cp38-macosx_10_12_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.8 macOS 10.12+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page