Correction dans le cas où on n'a pas de catégorie

This commit is contained in:
Jean-Marie Favreau 2024-09-04 11:41:38 +02:00
parent 1a06c45acc
commit 0a5470e73d
2 changed files with 3 additions and 3 deletions

View File

@ -28,8 +28,8 @@ from src.agenda_culturel.import_tasks.extractor_facebook import *
if __name__ == "__main__":
u2e = URL2Events(ChromiumHeadlessDownloader(), FacebookEventExtractor(single_event=True))
url="https://www.facebook.com/events/877079547620370/877079557620369/?active_tab=about"
u2e = URL2Events(ChromiumHeadlessDownloader(), FacebookEventExtractor())
url="https://www.facebook.com/events/s/tour-du-sud-invite-koum/430014373384441/"
events = u2e.process(url, cache = "fb.html", published = True)

View File

@ -260,7 +260,7 @@ class FacebookEventExtractor(Extractor):
logger.warning("published: " + str(published))
event["published"] = published
if "category" in default_values:
if default_values and "category" in default_values:
event["category"] = default_values["category"]
self.add_event(**event)
return self.get_structure()