Make JSON-LD @context parsing more robust

This commit is contained in:
aeph6Ee0 2018-04-05 12:47:24 +02:00
parent 5d60b99717
commit 1951bc12dc

View File

@ -1025,7 +1025,7 @@ class InfoExtractor(object):
})
for e in json_ld:
if e.get('@context') == 'http://schema.org':
if 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