Skip to content

A feature-rich command-line audio/video downloader

[youtube] Fix reference before assignment for video_info

Sergey M․bc93bdb5bbf4
diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py
index 46841617a4..45e5cb80ee 100644
--- a/youtube_dl/extractor/youtube.py
+++ b/youtube_dl/extractor/youtube.py
@@ -883,6 +883,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
add_dash_mpd(video_info)
else:
age_gate = False
+ video_info = None
# Try looking directly into the video webpage
mobj = re.search(r';ytplayer\.config\s*=\s*({.*?});', video_webpage)
if mobj: