diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py index 940f3def2..eaa2db1da 100644 --- a/yt_dlp/extractor/youtube.py +++ b/yt_dlp/extractor/youtube.py @@ -356,6 +356,8 @@ class YoutubeBaseInfoExtractor(InfoExtractor): return data.get('DELEGATED_SESSION_ID') def _extract_ytcfg(self, video_id, webpage): + if not webpage: + return {} return self._parse_json( self._search_regex( r'ytcfg\.set\s*\(\s*({.+?})\s*\)\s*;', webpage, 'ytcfg',