From 50f6f62895db617d0a14b0c1f49756825fdf821e Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 24 Apr 2019 16:53:44 +0200 Subject: [PATCH] Change download mode selection (thanks @MaxSensei666) --- royalnet/commands/play.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/royalnet/commands/play.py b/royalnet/commands/play.py index ba143da9..db54633d 100644 --- a/royalnet/commands/play.py +++ b/royalnet/commands/play.py @@ -44,9 +44,9 @@ class PlayNH(NetworkHandler): # TODO: change Exception raise Exception("No music_data for this guild") # Start downloading - try: + if message.url.startswith("http://") or message.url.startswith("https://"): audio_sources: typing.List[RoyalPCMAudio] = await asyncify(RoyalPCMAudio.create_from_url, message.url) - except youtube_dl.utils.DownloadError: + else: audio_sources = await asyncify(RoyalPCMAudio.create_from_ytsearch, message.url) await bot.add_to_music_data(audio_sources, guild) return PlaySuccessful(info_list=[source.rpf.info for source in audio_sources])