From 7711c07739023e4aae6b91a5fa8f04d6aaab20a6 Mon Sep 17 00:00:00 2001 From: pluja Date: Mon, 5 Oct 2020 17:00:20 +0200 Subject: [PATCH] Fixes bug with audo urls --- youtube_data/videos.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/youtube_data/videos.py b/youtube_data/videos.py index e9a10d9..15b4111 100644 --- a/youtube_data/videos.py +++ b/youtube_data/videos.py @@ -139,10 +139,6 @@ def get_video_primary_info(datad, datai): isUpcoming = False premieres = False views = details['viewCount'] - if not isLive: - audioURL = audio_urls[-1] - else: - audioURL = "#" ydl = YoutubeDL() @@ -169,7 +165,11 @@ def get_video_primary_info(datad, datai): } audio_urls.append(audio_inf) except: - continue + continue + if not isLive: + audioURL = audio_urls[-1] + else: + audioURL = "#" else: # If it is a scheduled video audio_urls = False formats = False