Pārlūkot izejas kodu

[extractor/common] Allow quoteless content attribute in og regexes (Closes #7115)

Sergey M․ 10 gadi atpakaļ
vecāks
revīzija
4180a3d8b7
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      youtube_dl/extractor/common.py

+ 1 - 1
youtube_dl/extractor/common.py

@@ -645,7 +645,7 @@ class InfoExtractor(object):
     # Helper functions for extracting OpenGraph info
     # Helper functions for extracting OpenGraph info
     @staticmethod
     @staticmethod
     def _og_regexes(prop):
     def _og_regexes(prop):
-        content_re = r'content=(?:"([^>]+?)"|\'([^>]+?)\')'
+        content_re = r'content=(?:"([^>]+?)"|\'([^>]+?)\'|\s*([^\s"\'=<>`]+?))'
         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'
         template = r'<meta[^>]+?%s[^>]+?%s'
         return [
         return [