From 8c54a3051df902ab734d76e6bd037c685e835282 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Wed, 21 Apr 2021 10:37:24 +0530 Subject: [PATCH] [youtube] Bugfix in `_extract_ytcfg` --- yt_dlp/extractor/youtube.py | 2 ++ 1 file changed, 2 insertions(+) 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 @@ def _extract_account_syncid(data): 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',