aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xlater9
1 files changed, 6 insertions, 3 deletions
diff --git a/later b/later
index a6ad804..12a6aa4 100755
--- a/later
+++ b/later
@@ -87,9 +87,12 @@ class TitleMap:
return self.extract(key)
def extract(self, key):
- # Make painstakingly sure that we only do this when absolutely
- # necessary: importing yt_dlp is noticeably slow :(
- import yt_dlp
+ try:
+ # Make painstakingly sure that we only do this when absolutely
+ # necessary: importing yt_dlp is noticeably slow :(
+ import yt_dlp
+ except ModuleNotFoundError:
+ sys.exit("later: yt-dlp was requested, but yt_dlp python module not found")
if not self.ytdl:
self.ytdl = yt_dlp.YoutubeDL({"logger": YTDLPLogger()})