浏览代码

[extractor/common] Skip html comment tags (Closes #6822)

Sergey M․ 10 年之前
父节点
当前提交
586f1cc532
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      youtube_dl/extractor/common.py

+ 1 - 0
youtube_dl/extractor/common.py

@@ -731,6 +731,7 @@ class InfoExtractor(object):
 
 
     @staticmethod
     @staticmethod
     def _hidden_inputs(html):
     def _hidden_inputs(html):
+        html = re.sub(r'<!--(?:(?!<!--).)*-->', '', html)
         hidden_inputs = {}
         hidden_inputs = {}
         for input in re.findall(r'(?i)<input([^>]+)>', html):
         for input in re.findall(r'(?i)<input([^>]+)>', html):
             if not re.search(r'type=(["\'])(?:hidden|submit)\1', input):
             if not re.search(r'type=(["\'])(?:hidden|submit)\1', input):