On nettoie l'url facebook si elle contient le nom de l'événement

This commit is contained in:
Jean-Marie Favreau 2024-10-17 10:48:37 +02:00
parent 499f90e88c
commit e1721db311

View File

@ -237,6 +237,12 @@ class FacebookEventExtractor(Extractor):
if FacebookEventExtractor.is_known_url(url): if FacebookEventExtractor.is_known_url(url):
u = urlparse(url) u = urlparse(url)
result = "https://www.facebook.com" + u.path 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] == "/": if result[-1] == "/":
return result[:-1] return result[:-1]
else: else: