Red-DiscordBot
Red-DiscordBot copied to clipboard
[Audio] Allow multiple urls for [p]play
What component of Red (cog, command, API) would you like to see improvements on?
Audio
Describe the enhancement you're suggesting.
i.e xplay song 1; song 2; song 3; song 4
Queued song 1; song 2; song 3; song 4
Anything else?
Which file would I need to look into for changes like these? Any guidance or insights?
audio_dataclasses.py
audio_logging.py
converters.py
equalizer.py
errors.py
manager.py
sql_statements.py
utils.py
I like the idea, that would be less boring to repeat the command again and again for searching 5 songs you want to add. However I can already smell some spam with it too, like being able to add as many videos as the message content allows you to (Who would appreciate getting Rick Rolled 100 times?), so I think we could only allow to add multiple titles up to 5 in one command, tell me your thoughts on it.
Also comes the part when I don't know how YouTube would react to fetching multiple videos, but I'm not really great with Lavalink stuff and when fetchings happens (is it when the song start playing or when looked up?) so we have to see if there's no negative effects coming along with this change if it becomes a thing. But I guess it's fine since we have a similar thing with playlists.
I'm glad you liked the idea! Limit to max multi queue definitely sounds like an awesome idea to prevent community server spams.
However I can already smell some spam with it too, like being able to add as many videos as the message content allows you to
I don't see any issues with that sort of thing, considering you can already [p]play
a playlist which adds all the songs on that playlist.
The major concern that I can see would be picking a delimitator that would never show up in a URL, technically a space should be fine?
Better options for the delim are a newline or pipe (|
) character.
The most optimal option, imho, is newline. Pipe character can be used in video names, and [p]play
supports, and, is often used for search-and-play.
The only file that would need to be changed here is the file that adds the play command all you'd have to do change the query argument to a consume all, and do a splitlines on it and iterate through every line using the existing code.
However there are some issues with this and why I didn't add it originally, the way that audio currently enqueue tracks could mean this command could easily exhaust the YouTube quota of the bot owner, so it should be restricted to non Spotify playlist/album queries.
Pylav currently doing this but given that Spotify queries as partials it does allow for Spotify queries.
Another issue with Red and this is the risk of YouTube 429s from multiple searches in succession which would essentially be a DoS attack vector if searches are allowed here, a use could in turn send 1000+ search queries which will trigger a YouTube 429