1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-27 13:34:28 +00:00

Change download mode selection (thanks @MaxSensei666)

This commit is contained in:
Steffo 2019-04-24 16:53:44 +02:00
parent b7dd8b131b
commit 50f6f62895

View file

@ -44,9 +44,9 @@ class PlayNH(NetworkHandler):
# TODO: change Exception # TODO: change Exception
raise Exception("No music_data for this guild") raise Exception("No music_data for this guild")
# Start downloading # 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) 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) audio_sources = await asyncify(RoyalPCMAudio.create_from_ytsearch, message.url)
await bot.add_to_music_data(audio_sources, guild) await bot.add_to_music_data(audio_sources, guild)
return PlaySuccessful(info_list=[source.rpf.info for source in audio_sources]) return PlaySuccessful(info_list=[source.rpf.info for source in audio_sources])