On améliore la trace et la gestion des erreurs
This commit is contained in:
parent
de4d00064f
commit
56fb77974c
@ -258,9 +258,9 @@ class TwoStepsExtractor(Extractor):
|
|||||||
content_event, event_url, url_human, default_values, published
|
content_event, event_url, url_human, default_values, published
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.info('Using cookie trick on a facebook event')
|
|
||||||
# some website (FB) sometime need a second step
|
# some website (FB) sometime need a second step
|
||||||
if first and len(self.events) == 0 and self.has_2nd_method_in_list and self.downloader.support_2nd_extract:
|
if first and len(self.events) == 0 and self.has_2nd_method_in_list and self.downloader.support_2nd_extract:
|
||||||
|
logger.info('Using cookie trick on a facebook event')
|
||||||
first = False
|
first = False
|
||||||
self.prepare_2nd_extract_in_list()
|
self.prepare_2nd_extract_in_list()
|
||||||
content_event = self.downloader.get_content(event_url)
|
content_event = self.downloader.get_content(event_url)
|
||||||
@ -268,6 +268,8 @@ class TwoStepsExtractor(Extractor):
|
|||||||
self.add_event_from_content(
|
self.add_event_from_content(
|
||||||
content_event, event_url, url_human, default_values, published
|
content_event, event_url, url_human, default_values, published
|
||||||
)
|
)
|
||||||
|
else:
|
||||||
|
raise e
|
||||||
|
|
||||||
|
|
||||||
return self.get_structure()
|
return self.get_structure()
|
||||||
|
@ -43,9 +43,10 @@ class URL2Events:
|
|||||||
if len(events) > 0:
|
if len(events) > 0:
|
||||||
return events
|
return events
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.warning("cas sans event")
|
|
||||||
if first and FacebookEventExtractor.is_known_url(url) and self.downloader.support_2nd_extract and e.has_2nd_method:
|
if first and FacebookEventExtractor.is_known_url(url) and self.downloader.support_2nd_extract and e.has_2nd_method:
|
||||||
logger.warning("on avance")
|
logger.info('Using cookie trick on a facebook event')
|
||||||
e.prepare_2nd_extract()
|
e.prepare_2nd_extract()
|
||||||
return self.process(url, url_human, cache, default_values, published, False)
|
return self.process(url, url_human, cache, default_values, published, False)
|
||||||
|
else:
|
||||||
|
raise e
|
||||||
return None
|
return None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user