* [Audio] Update for Red-Lavalink #55
* Update setup.cfg
* Catch all the exceptions
* Update version range on Red-Lavalink
* Catch excepts on Spotify tracks/playlist upload
* No prefix needed
* Refactor internal Lavalink server management
Killing many birds with one stone here.
- Made server manager into class-based API with two public methods: `start()` and `shutdown()`. Must be re-instantiated each time it is restarted.
- Using V3 universal Lavalink.jar hosted on Cog-Creators/Lavalink-Jars repository.
- Uses output of `java -jar Lavalink.jar --version` to check if a new jar needs to be downloaded.
- `ServerManager.start()` won't return until server is ready, i.e. when "Started Launcher in X seconds" message is printed to STDOUT.
- `shlex.quote()` is used so spaces in path to Lavalink.jar don't cause issues.
- Enabling external Lavalink will cause internal server to be terminated.
- Disabling internal Lavalink will no longer reset settings in config - instead, hard-coded values will be used when connecting to an internal server.
- Internal server will now run both WS and REST servers on port 2333, meaning one less port will need to be taken up.
- Now using `asyncio.subprocess` module so waiting on and reading from subprocesses can be done asynchronously.
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
* Don't use shlex.quote on Windows
Signed-off-by: Toby <tobyharradine@gmail.com>
* Don't use shlex.quote at all
I misread a note in the python docs and assumed it was best to use it. Turns out the note only applies to `asyncio.create_subprocess_shell`.
Signed-off-by: Toby <tobyharradine@gmail.com>
* Missed the port on the rebase
* Ignore invalid architectures and inform users when commands are used.
* Style fix
* Dependency update
discord.py==1.0.1
websockets<7
[style]
black==19.3b0
[Docs]
jinja==2.10.1
urllib3==1.24.2
Changes related to breaking changes from discord.py have also been made
to match
As of this commit, help formatter is back to discord.py's default
* [V3 Audio] Add Spotify support
* [V3 Audio] Update LICENSE
* Appeasing the style gods
* Extra word removal on LICENSE
* Update for #2389
Thanks to TrustyJAID for the help.
* Playlist command support for Spotify URLs or codes
* Add exception for dc while loading Spotify tracks
* Allow Spotify urls by default in audioset restrict
Matches the behavior of Spotify codes already being allowed by default.
* Update audio.py
* .format() moving
* Added a character to try to make Travis behave
- Seek can now seek to a specific position, formatted like 00:00:00 or 00:00. Using negative or positive ints still functions the same as previously and will seek ahead or behind by that value instead.
- This PR requires the `_time_convert` func added in #2465 and should be merged after that one.
Revert player.is_playing check added to the playing players list for audioset status in #2473. This addition would cause no status to be shown when a local track was played and skip was used.
Searching for a song and pressing the reaction to queue a song would not add the song to the queue if `[p]audioset maxlength` was off. This was an omission from #2465.
This addition adds a toggle for having the bot instantly disconnect when the queue ends. It takes precedence over the `[p]audioset emptydisconnect` setting as it disconnects immediately when the queue or single song is finished.
Also included a Makefile recipe which makes use of the Crowdin CLI's `crowdin download` command. This requires whoever is using it to provide the project's API key in an environment variable, but we may automate this at some point.
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
Bot owners can use `[p]playlist download playlistname` to download a playlist file that is compatible with the playlist upload command. Songs can also be exported for v2 use by using `[p]playlist download playlistname True`, which strips out tracks besides YouTube or Soundcloud URLs.
* Added `[p]audioset maxlength`, which takes seconds or 00:00-style of formatted input for restricting the player to songs that have a length under that threshold.
- Refactored disconnect_timer, the function behind audioset emptydisconnect, to be more appropriately responsive (thanks to TrustyJAID)
- Refactored status clearing/status changing when emptydisconnect or other Lavalink player statuses would have a TRACK_END event but no QUEUE_END event. This should clear or modify the bot's status event appropriately when [p]audioset status is on and the bot disconnects due to emptydisconnect and ideally play a little nicer with other cogs that set statuses.
`[p]local folder` will now accept folder names in the command instead of having to navigate through the reaction menu. Also added an alias of `[p]local start` to help users coming from v2 audio.
Also:
- restart and reconnect if connection settings change
- shutdown and restart if not configured to use external
- show a message in [p]play et al. when the connection hasn't been made
- move the JAR download to manager so audio.py can access it
- only start if no process exists
- bump red-lavalink to 0.2.3
Resolves#2306
Also:
- restart and reconnect if connection settings change
- shutdown and restart if not configured to use external
- show a message in [p]play et al. when the connection hasn't been made
- move the JAR download to manager so audio.py can access it
- only start if no process exists
Resolves#2306
- Update to red-lavalink v0.2.0 (blocked by Cog-Creators/Red-Lavalink#41)
- Force lavalink to use TLSv1.2 on java 11+ (blocked by #2270)
I would add equalizer support, but there's no way to know the full
Lavalink version and thus whether it's supported ahead of time.
* regex extension on java -version
* make it a non capturing group
* alphanumeric matching
* Match specification: Style, line length
* Update manager.py
Using the OpenJDK 11 from java.net on Ubuntu 18 reports "11" as the version, which failed the Java version check on loading audio on a new instance. This change will return "11 0" as the version, passing the check, instead of just "11".
Renames the `current_build` key to `current_version`. This means the `current_version` key will always be a dict and never a list, and `current_build` having no defaults means it won't mess with `[p]audioset settings`.
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
current_build is now set as a dict, but its default was a list.
This resolves the error an `[p]audioset settings`.
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>