1
This commit is contained in:
29
main.py
29
main.py
@@ -46,8 +46,12 @@ ffmpeg_options = {
|
||||
'options': '-vn'
|
||||
}
|
||||
|
||||
ffmpeg_super_bass_options = {
|
||||
'options': '-af "equalizer=f=160:width_type=o:width=1:g=10, equalizer=f=30:width_type=o:width=1:g=5, equalizer=f=50:width_type=o:width=1:g=5"'
|
||||
}
|
||||
|
||||
ffmpeg_bass_options = {
|
||||
'options': '-af "firequalizer=gain_entry="entry(0,-8);entry(250,4);entry(1000,-8);entry(4000,0);entry(16000,-8)""'
|
||||
'options': '-af "equalizer=f=160:width_type=o:width=1:g=10, equalizer=f=30:width_type=o:width=1:g=3, equalizer=f=50:width_type=o:width=1:g=3"'
|
||||
}
|
||||
|
||||
ytdl = youtube_dl.YoutubeDL(ytdl_format_options)
|
||||
@@ -74,6 +78,29 @@ class YTDLSource(discord.PCMVolumeTransformer):
|
||||
filename = data['url'] if stream else ytdl.prepare_filename(data)
|
||||
return cls(discord.FFmpegPCMAudio(filename, **ffmpeg_options), data=data)
|
||||
|
||||
@classmethod
|
||||
async def bass_from_url(cls, url, *, loop=None, stream=False):
|
||||
loop = loop or asyncio.get_event_loop()
|
||||
data = await loop.run_in_executor(None, lambda: ytdl.extract_info(url, download=not stream))
|
||||
|
||||
if 'entries' in data:
|
||||
# take first item from a playlist
|
||||
data = data['entries'][0]
|
||||
|
||||
filename = data['url'] if stream else ytdl.prepare_filename(data)
|
||||
return cls(discord.FFmpegPCMAudio(filename, **ffmpeg_bass_options), data=data)
|
||||
|
||||
@classmethod
|
||||
async def superbass_from_url(cls, url, *, loop=None, stream=False):
|
||||
loop = loop or asyncio.get_event_loop()
|
||||
data = await loop.run_in_executor(None, lambda: ytdl.extract_info(url, download=not stream))
|
||||
|
||||
if 'entries' in data:
|
||||
# take first item from a playlist
|
||||
data = data['entries'][0]
|
||||
|
||||
filename = data['url'] if stream else ytdl.prepare_filename(data)
|
||||
return cls(discord.FFmpegPCMAudio(filename, **ffmpeg_super_bass_options), data=data)
|
||||
|
||||
class Music(commands.Cog):
|
||||
def __init__(self, bot):
|
||||
|
||||
Reference in New Issue
Block a user