On modifie la condition d'échec des pages FB

This commit is contained in:
Jean-Marie Favreau 2025-03-09 15:16:56 +01:00
parent 629a8509cb
commit d401f533bd

View File

@ -32,9 +32,9 @@ class CExtractor(TwoStepsExtractor):
) )
self.found = True self.found = True
else: else:
if "__typename" in array:
self.has_typename = True
for k in array: for k in array:
if k == "pageItems":
self.has_page_items = True
self.find_event_id_fragment_in_array(array[k]) self.find_event_id_fragment_in_array(array[k])
elif isinstance(array, list): elif isinstance(array, list):
for e in array: for e in array:
@ -62,7 +62,7 @@ class CExtractor(TwoStepsExtractor):
self.add_event_url(href.split("?")[0]) self.add_event_url(href.split("?")[0])
self.found = True self.found = True
self.has_page_items = False self.has_typename = False
self.find_in_js(soup) self.find_in_js(soup)
if not self.found: if not self.found:
@ -72,7 +72,7 @@ class CExtractor(TwoStepsExtractor):
if debug: if debug:
CExtractor.dump_content_for_debug(content, self.url) CExtractor.dump_content_for_debug(content, self.url)
if not self.has_page_items: if not self.has_typename:
raise Exception( raise Exception(
_( _(
"the page was not yet populated with events, so the loading time was probably too short" "the page was not yet populated with events, so the loading time was probably too short"