From 5aa80c6fc92aa44f75875c40f091731be94a70c2 Mon Sep 17 00:00:00 2001 From: 20xd6 <20xd6@airmail.cc> Date: Thu, 14 Sep 2023 10:28:00 -0400 Subject: [PATCH] Catch missing imports --- download.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/download.py b/download.py index 38f5e07..f94b43e 100644 --- a/download.py +++ b/download.py @@ -1,5 +1,11 @@ -import yt_dlp as yt -from plyer import notification +try: + import yt_dlp as yt + from plyer import notification +except: + import os + script_dir = os.path.dirname(os.path.realpath(__file__)) + print("Please install dependances.\n" + + "This can be done with the command 'pip3 install -r " + script_dir + "/requierments.txt'") def get(yt_url): ytdl_options = {