浏览代码

[YouTube] Avoid early crash if webpage can't be read
* see issue #33013

dirkf 8 月之前
父节点
当前提交
176fc2cb00
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      youtube_dl/extractor/youtube.py

+ 1 - 1
youtube_dl/extractor/youtube.py

@@ -1951,7 +1951,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
             pb_context = {'html5Preference': 'HTML5_PREF_WANTS'}
             pb_context = {'html5Preference': 'HTML5_PREF_WANTS'}
 
 
             player_url = self._extract_player_url(webpage)
             player_url = self._extract_player_url(webpage)
-            ytcfg = self._extract_ytcfg(video_id, webpage)
+            ytcfg = self._extract_ytcfg(video_id, webpage or '')
             sts = self._extract_signature_timestamp(video_id, player_url, ytcfg)
             sts = self._extract_signature_timestamp(video_id, player_url, ytcfg)
             if sts:
             if sts:
                 pb_context['signatureTimestamp'] = sts
                 pb_context['signatureTimestamp'] = sts