A feature-rich command-line audio/video downloader
Do not override stdlib html parser 'locatestarttagend' regex (fixes #4081)
Jaime Marquínez Ferrándiz4f195f55f0b7
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.pyindex 233286de84..bdd637e488 100644--- a/youtube_dl/utils.py+++ b/youtube_dl/utils.py@@ -152,7 +152,9 @@ def xpath_text(node, xpath, name=None, fatal=False):return n.text-compat_html_parser.locatestarttagend = re.compile(r"""<[a-zA-Z][-.a-zA-Z0-9:_]*(?:\s+(?:(?<=['"\s])[^\s/>][^\s/=>]*(?:\s*=+\s*(?:'[^']*'|"[^"]*"|(?!['"])[^>\s]*))?\s*)*)?\s*""", re.VERBOSE) # backport bugfix+if sys.version_info < (2, 7):+ compat_html_parser.locatestarttagend = re.compile(r"""<[a-zA-Z][-.a-zA-Z0-9:_]*(?:\s+(?:(?<=['"\s])[^\s/>][^\s/=>]*(?:\s*=+\s*(?:'[^']*'|"[^"]*"|(?!['"])[^>\s]*))?\s*)*)?\s*""", re.VERBOSE) # backport bugfix+class BaseHTMLParser(compat_html_parser.HTMLParser):def __init(self):compat_html_parser.HTMLParser.__init__(self)