diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py
index e02176852..45dd01789 100644
--- a/youtube_dl/extractor/common.py
+++ b/youtube_dl/extractor/common.py
@@ -316,10 +316,12 @@ def _get_login_info(self):
# Helper functions for extracting OpenGraph info
@staticmethod
def _og_regexes(prop):
- esc_prop = re.escape(prop)
+ content_re = r'content=(?:"([^>]+?)"|\'(.+?)\')'
+ property_re = r'property=[\'"]og:%s[\'"]' % re.escape(prop)
+ template = r']+?%s[^>]+?%s'
return [
- r']+?property=[\'"]og:%s[\'"][^>]+?content=(?:"(.+?)"|\'(.+?)\')' % esc_prop,
- r']+?content=(?:"(.+?)"|\'(.+?)\')[^>]+?property=[\'"]og:%s[\'"]' % esc_prop,
+ template % (property_re, content_re),
+ template % (content_re, property_re),
]
def _og_search_property(self, prop, html, name=None, **kargs):