From fd9864057220166b41adaee74ad1ab0466e92331 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 31 Jul 2018 18:21:36 +0200 Subject: [PATCH] Fixato un bug in cui il musicbot non scaricava video --- discordbot.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/discordbot.py b/discordbot.py index 86a662f3..79ce34c2 100644 --- a/discordbot.py +++ b/discordbot.py @@ -318,6 +318,11 @@ async def add_video_from_url(url, index: typing.Optional[int]=None, enqueuer: di "simulate": True}) as ytdl: info = await loop.run_in_executor(executor, functools.partial(ytdl.extract_info, url=url, download=False)) + if info is None: + await client.send_message(client.get_channel(config["Discord"]["main_channel"]), + f"⚠ Non è stato trovato nessun video all'URL `{url}`," + f" pertanto non è stato aggiunto alla coda.") + return if "entries" in info: # This is a playlist for entry in info["entries"]: