Skip to content

A feature-rich command-line audio/video downloader

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

Sergey M․586f1cc532d1
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py
index 835f6f368c..d694e818e9 100644
--- a/youtube_dl/extractor/common.py
+++ b/youtube_dl/extractor/common.py
@@ -731,6 +731,7 @@ class InfoExtractor(object):
@staticmethod
def _hidden_inputs(html):
+ html = re.sub(r'<!--(?:(?!<!--).)*-->', '', html)
hidden_inputs = {}
for input in re.findall(r'(?i)<input([^>]+)>', html):
if not re.search(r'type=(["\'])(?:hidden|submit)\1', input):