ソースを参照

[extractor/common] Relax JSON-LD context check (closes #16006)

aeph6Ee0 7 年 前
コミット
66b686727b
1 ファイル変更1 行追加1 行削除
  1. 1 1
      youtube_dl/extractor/common.py

+ 1 - 1
youtube_dl/extractor/common.py

@@ -1025,7 +1025,7 @@ class InfoExtractor(object):
             })
 
         for e in json_ld:
-            if e.get('@context') == 'http://schema.org':
+            if isinstance(e.get('@context'), compat_str) and re.match(r'^https?://schema.org/?$', e.get('@context')):
                 item_type = e.get('@type')
                 if expected_type is not None and expected_type != item_type:
                     return info