diff --git a/files/routes/settings.py b/files/routes/settings.py index 707178189..828397897 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -865,7 +865,12 @@ def settings_song_change(v): if YOUTUBE_KEY != DEFAULT_CONFIG_VALUE: req = requests.get(f"https://www.googleapis.com/youtube/v3/videos?id={id}&key={YOUTUBE_KEY}&part=contentDetails", timeout=5).json() - duration = req['items'][0]['contentDetails']['duration'] + + try: + duration = req['items'][0]['contentDetails']['duration'] + except: + return redirect("/settings/personal?error=Anthem change failed, please try another video!") + if duration == 'P0D': return redirect("/settings/personal?error=Can't use a live youtube video!")