瀏覽代碼

[YouTube] Avoid crash in author extraction

dirkf 2 年之前
父節點
當前提交
fa7f0effbe
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      youtube_dl/extractor/youtube.py

+ 1 - 1
youtube_dl/extractor/youtube.py

@@ -448,7 +448,7 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
             extract_attributes(self._search_regex(
             extract_attributes(self._search_regex(
                 r'''(?s)(<link\b[^>]+\bitemprop\s*=\s*("|')%s\2[^>]*>)'''
                 r'''(?s)(<link\b[^>]+\bitemprop\s*=\s*("|')%s\2[^>]*>)'''
                 % re.escape(var_name),
                 % re.escape(var_name),
-                get_element_by_attribute('itemprop', 'author', webpage) or '',
+                get_element_by_attribute('itemprop', 'author', webpage or '') or '',
                 'author link', default='')),
                 'author link', default='')),
             paths[var_name][0])
             paths[var_name][0])