[extractor/common] Allow HTML5 unquoted attribute values
authorYen Chi Hsuan <yan12125@gmail.com>
Fri, 9 Oct 2015 06:11:00 +0000 (14:11 +0800)
committerYen Chi Hsuan <yan12125@gmail.com>
Fri, 9 Oct 2015 06:11:00 +0000 (14:11 +0800)
Fixes #7108

HTML5 allows unquoted attribute values. See the "Unquoted attribute value
syntax" section [1] for more information

[1] http://www.w3.org/TR/html5/syntax.html

youtube_dl/extractor/common.py

index dbae75406233ae8d5d2db2acf2090e6522a91295..242618c583d96afecf87ecf90d69b85c02456646 100644 (file)
@@ -646,7 +646,7 @@ class InfoExtractor(object):
     @staticmethod
     def _og_regexes(prop):
         content_re = r'content=(?:"([^>]+?)"|\'([^>]+?)\')'
-        property_re = r'(?:name|property)=[\'"]og:%s[\'"]' % re.escape(prop)
+        property_re = r'(?:name|property)=[\'"]?og:%s[\'"]?' % re.escape(prop)
         template = r'<meta[^>]+?%s[^>]+?%s'
         return [
             template % (property_re, content_re),