diff --git a/src/agenda_culturel/import_tasks/extractor_facebook.py b/src/agenda_culturel/import_tasks/extractor_facebook.py index d74c1c2..c56167d 100644 --- a/src/agenda_culturel/import_tasks/extractor_facebook.py +++ b/src/agenda_culturel/import_tasks/extractor_facebook.py @@ -237,6 +237,12 @@ class FacebookEventExtractor(Extractor): if FacebookEventExtractor.is_known_url(url): u = urlparse(url) result = "https://www.facebook.com" + u.path + + # remove name in the url + match = re.match(r"(.*/events)/s/([a-zA-Z-][a-zA-Z-0-9]+)/([0-9/]*)", result) + if match: + result = match[1] + "/" + match[3] + if result[-1] == "/": return result[:-1] else: