From eb5385b04ab802d06e2e6639cd6028f340057e6d Mon Sep 17 00:00:00 2001 From: Arnaud Baes Date: Wed, 8 Nov 2023 11:37:09 +0100 Subject: [PATCH] [FIX] website_event_track_live: Properly catch `youtube_video_id` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On live youtube videos, url are in reality like this: `https://www.youtube.com/live/` which was not properly caught by the regex in its compute Reported during OXP closes odoo/odoo#141910 X-original-commit: fd348c6778138240d67aa778866cd9e4d49c5021 Signed-off-by: Warnon Aurélien (awa) --- addons/website_event_track_live/models/event_track.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_event_track_live/models/event_track.py b/addons/website_event_track_live/models/event_track.py index 5a0642d4a8c..4bbb16cd746 100644 --- a/addons/website_event_track_live/models/event_track.py +++ b/addons/website_event_track_live/models/event_track.py @@ -20,7 +20,7 @@ class Track(models.Model): def _compute_youtube_video_id(self): for track in self: if track.youtube_video_url: - regex = r'^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*' + regex = r'^.*(youtu.be\/|v\/|u\/\w\/|embed\/|live\/|watch\?v=|&v=)([^#&?]*).*' match = re.match(regex, track.youtube_video_url) if match and len(match.groups()) == 2 and len(match.group(2)) == 11: track.youtube_video_id = match.group(2)