Only search YouTube when enabled

This commit is contained in:
Parker M. 2024-11-29 00:09:31 -06:00
parent e73db927c1
commit 8b231a1b54
Signed by: parker
GPG Key ID: 505ED36FC12B5D5E

View File

@ -6,6 +6,8 @@ from lavalink import (
PlaylistInfo,
)
from utils.config import YOUTUBE_SUPPORT
class LoadError(
Exception
@ -32,6 +34,7 @@ class CustomAudioTrack(DeferredAudioTrack):
LoadType.EMPTY,
LoadType.ERROR,
):
if YOUTUBE_SUPPORT:
ytmsearch = f"ytmsearch:{self.title} {self.author}"
results = await client.get_tracks(ytmsearch)