From: Sergey M․ Date: Fri, 6 May 2016 16:07:30 +0000 (+0600) Subject: [utils] Allow empty attribute values in get_element_by_attribute (Closes #9415) X-Git-Url: http://git.oshgnacknak.de/?a=commitdiff_plain;h=abc97b5eda4ed4b36cec29e9966eb1bb7bcd97ce;p=youtube-dl [utils] Allow empty attribute values in get_element_by_attribute (Closes #9415) --- diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index a5922b2b5..6e4573784 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -256,9 +256,9 @@ def get_element_by_attribute(attribute, value, html): m = re.search(r'''(?xs) <([a-zA-Z0-9:._-]+) - (?:\s+[a-zA-Z0-9:._-]+(?:=[a-zA-Z0-9:._-]+|="[^"]+"|='[^']+'))*? + (?:\s+[a-zA-Z0-9:._-]+(?:=[a-zA-Z0-9:._-]*|="[^"]*"|='[^']*'))*? \s+%s=['"]?%s['"]? - (?:\s+[a-zA-Z0-9:._-]+(?:=[a-zA-Z0-9:._-]+|="[^"]+"|='[^']+'))*? + (?:\s+[a-zA-Z0-9:._-]+(?:=[a-zA-Z0-9:._-]*|="[^"]*"|='[^']*'))*? \s*> (?P.*?)