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:
parent
b7dd8b131b
commit
50f6f62895
1 changed files with 2 additions and 2 deletions
|
@ -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])
|
||||
|
|
Loading…
Reference in a new issue