]> jfr.im git - yt-dlp.git/commitdiff
[youtube] Bugfix in `_extract_ytcfg`
authorpukkandan <redacted>
Wed, 21 Apr 2021 05:07:24 +0000 (10:37 +0530)
committerpukkandan <redacted>
Wed, 21 Apr 2021 05:07:24 +0000 (10:37 +0530)
yt_dlp/extractor/youtube.py

index 940f3def2f6a8cdd80eaa3d33d26931a9578ac86..eaa2db1da87a394f4ff871b743f765a44489fee1 100644 (file)
@@ -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',