diff --git a/nowplaying.py b/nowplaying.py index 1cfe26d..bae1979 100644 --- a/nowplaying.py +++ b/nowplaying.py @@ -46,7 +46,10 @@ class NowplayingBot(PineappleBot): # make a best-effort guess at the youtube link for this track yt_search = search_youtube(str(currently_playing), key=self.config.youtube_key) - yt_link = f"https://www.youtube.com/watch?v={yt_search[0]['id']}" + if yt_search is not None: + yt_link = f"https://www.youtube.com/watch?v={yt_search[0]['id']}" + else: + yt_link = ':sparkler: no youtube link, sorry :sparkler:' # template the post post_template = '''\