On rend plus robuste l'import (dans le cas où il manque des informations)

This commit is contained in:
Jean-Marie Favreau 2023-12-17 15:28:42 +01:00
parent b9ecde46e5
commit 3520045856

View File

@ -144,10 +144,15 @@ class ExtractorFacebook(Extractor):
self.get_neighbor_events(event[k])
elif k in ExtractorFacebook.FacebookEvent.rules:
for nk, rule in ExtractorFacebook.FacebookEvent.rules[k].items():
error = False
c = event[k]
for ki in rule:
c = c[ki]
self.elements[nk] = c
if c is not None:
c = c[ki]
else:
error = True
if not error:
self.elements[nk] = c
else:
self.elements[k] = event[k]