Skip to main content

A Lavalink WebSocket & API wrapper for discord.py

Project description

pre-commit.ci status GitHub license Support Server PyPi Documentation Status

Documentation

Installation


Requirements

Environment Variables

Note - All environment variables except PYLAV__LOGGER_PREFIX can be configured from the pylav.yaml file which should reside in the home directory of the user running the bot. An example of the file can be found at pylav.example.yaml, if you don't create the file yourself pylav will do so on the first run, and once the file exists it will be preferred over the Environment Variable set.

Required

  • Env Vars to connect the lib to the PostgresSQL server All Envvars default to AsyncPG defaults
    • PYLAV__POSTGRES_PORT
    • PYLAV__POSTGRES_PASSWORD
    • PYLAV__POSTGRES_USER
    • PYLAV__POSTGRES_DB
    • PYLAV__POSTGRES_HOST

Optional

  • Env Vars to connect the lib cache to Redis, note if these are missing the library will default to PostgresSQL, therefore they are not necessary.
    • This will be used by the aiohttp cached client session for storing cached responses for 1 day, this reduces stress on some of the requests the lib makes such as to RadioBrowser.
      • PYLAV__REDIS_FULL_ADDRESS_RESPONSE_CACHE
        • e.g. redis://[[username]:[password]]@localhost:6379/0
        • e.g. unix://[[username]:[password]]@/path/to/socket.sock?db=0
  • Misc
    • PYLAV__LOGGER_PREFIX - Sets the logger prefix, defaults to None, or "red." if redbot is installed.
    • PYLAV__JAVA_EXECUTABLE - Sets the Java executable to be used by PyLav for the managed Lavalink node
    • PYLAV__USE_BUNDLED_EXTERNAL_PYLAV_NODE - Enabled the bundled PyLav external nodes, this is enabled by default as it is not recommended to disable this option.
    • PYLAV__USE_BUNDLED_EXTERNAL_LAVA_LINK_NODE - Enabled the bundled lava.link node, this is disabled by default as it is not recommended to enable this option.
  • Unmanaged External Node - If both PYLAV__EXTERNAL_UNMANAGED_HOST and PYLAV__EXTERNAL_UNMANAGED_PASSWORD are set then the managed node is not started up
    • PYLAV__EXTERNAL_UNMANAGED_HOST - No Default - Required (Should not contain the protocol i.e "http" or "https", this is determined by PYLAV__EXTERNAL_UNMANAGED_SSL)
    • PYLAV__EXTERNAL_UNMANAGED_PASSWORD - No Default - Required
    • PYLAV__EXTERNAL_UNMANAGED_PORT - Defaults to 80
    • PYLAV__EXTERNAL_UNMANAGED_SSL - Defaults to 0 (i.e False) - Possible values are 0 - 1
  • Tasks Timers
    • PYLAV__TASK_TIMER_UPDATE_BUNDLED_PLAYLISTS: Defaults to 1 # How many days to wait between updates - Minimum 1 Day.
    • PYLAV__TASK_TIMER_UPDATE_BUNDLED_EXTERNAL_PLAYLISTS: Defaults to 7 # How many days to wait between updates - Minimum 7 Days.
    • PYLAV__TASK_TIMER_UPDATE_EXTERNAL_PLAYLISTS: Defaults to 7 # How many days to wait between updates - Minimum 7 Days.

Supported sources

Built-in:

  • youtube
  • soundcloud
  • twitch
  • bandcamp
  • vimeo
  • http
  • local

With Topis-Source-Managers-Plugin:

  • spotify
  • applemusic

With DuncteBot-plugin:

  • getyarn
  • clypit
  • tts
  • pornhub
  • reddit
  • ocremix
  • tiktok
  • mixcloud

With Google Cloud TTS:

  • gcloud-tts

With Sponsorblock-Plugin:

  • sponsorblock

Supported Lavalink features

  • Supports all features of Lavalink
    • Filters
    • IP Rotation
    • Plug-ins

Features

  • Multiple node support
    • Node region assignment based on IP
  • Track cache for the last 30 days to reduce the number of duplicated queries
  • Managed local node with auto-restart and auto update
  • Many helper methods and functions
  • Support for multiple cogs to access the library at once
  • Playlists and EQ saved at a library level to be shared with cogs
  • Player state persistence
    • Upon library state being shutdown all player states are saved and restored on library startup
  • History of played tracks available for players
  • RadioBrowser.org API to retrieve radio stations available for players
  • M3U, PLS and PYLAV text file parser to convert contents into a playlist (p.s. Lavalink must support the format/coded of files still)

Credits

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

Py-Lav-0.4.2.tar.gz (337.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Py_Lav-0.4.2-py3-none-any.whl (365.4 kB view details)

Uploaded Python 3

File details

Details for the file Py-Lav-0.4.2.tar.gz.

File metadata

  • Download URL: Py-Lav-0.4.2.tar.gz
  • Upload date:
  • Size: 337.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for Py-Lav-0.4.2.tar.gz
Algorithm Hash digest
SHA256 ad63b4ea56375a104dc34519fd2b503bcfcea047e15f5115691ead4349645980
MD5 e41b51cb8d7d714e76593c247228e2d2
BLAKE2b-256 35cbfc0bab2db00ce81294ac5f76fbe574754c9049af39d9fb334015f86b3540

See more details on using hashes here.

File details

Details for the file Py_Lav-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: Py_Lav-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 365.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for Py_Lav-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 974af5a795c388f64d5b0c9262c5cd39a939772316da438a36185ebfd974c082
MD5 053353f3da4cb922c3b040743442ca84
BLAKE2b-256 8439e4c17584e616653da5130ddfc149e62401e984bc7ba0800dbe8e3345e83e

See more details on using hashes here.

Supported by

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