Check if '@context' value in JSON-LD is a String
This commit is contained in:
parent
6c33309a3f
commit
f8ef225de4
@ -1025,7 +1025,7 @@ class InfoExtractor(object):
|
|||||||
})
|
})
|
||||||
|
|
||||||
for e in json_ld:
|
for e in json_ld:
|
||||||
if '@context' in e and re.match(r'^https?://schema.org/?$', e.get('@context')):
|
if isinstance(e.get('@context'), str) and re.match(r'^https?://schema.org/?$', e.get('@context')):
|
||||||
item_type = e.get('@type')
|
item_type = e.get('@type')
|
||||||
if expected_type is not None and expected_type != item_type:
|
if expected_type is not None and expected_type != item_type:
|
||||||
return info
|
return info
|
||||||
|
Loading…
x
Reference in New Issue
Block a user