diff options
author | Wolfgang Müller | 2024-09-20 11:39:55 +0200 |
---|---|---|
committer | Wolfgang Müller | 2024-09-22 19:40:03 +0200 |
commit | 53f2fab8f95d8da98007beb977c2b85fb88d2399 (patch) | |
tree | a594cd37084e16c2bc7362d67e7e35fcb19b734c | |
parent | 79b22d8e4c900c8b8ea7c6fbda7c07493cbb5793 (diff) | |
download | later-53f2fab8f95d8da98007beb977c2b85fb88d2399.tar.gz |
Handle a missing yt_dlp module
Diffstat (limited to '')
-rwxr-xr-x | later | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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()}) |