1
0
Fork 0
mirror of synced 2024-06-23 08:40:41 +12:00

Added a check to remove unliked characters in the song name, i.e. []<>

This commit is contained in:
Phxntxm 2016-10-29 15:30:30 -05:00
parent ebb4add7c9
commit 01acaa3e51

View file

@ -9,6 +9,7 @@ import functools
import datetime
import time
import asyncio
import re
if not discord.opus.is_loaded():
discord.opus.load_opus('/usr/lib64/libopus.so.0')
@ -352,6 +353,7 @@ class Music:
# Create the player, and check if this was successful
# Here all we want is to get the information of the player
try:
song = re.sub('[<>\[\]]', '', song)
func = functools.partial(self.ytdl.extract_info, song, download=False)
info = await self.bot.loop.run_in_executor(None, func)
if "entries" in info: