fix: support youtube watch links as preview links

(cherry picked from commit f63a4a44a2)
This commit is contained in:
Jannat Patel
2026-03-02 13:01:59 +05:30
committed by Mergify
parent c77fdf55b3
commit c01cfc4672
2 changed files with 3 additions and 2 deletions
-1
View File
@@ -696,7 +696,6 @@ export const escapeHTML = (text) => {
'"': '"',
"'": ''',
'`': '`',
'=': '=',
}
return String(text).replace(
+3 -1
View File
@@ -47,7 +47,9 @@ class LMSCourse(Document):
).save(ignore_permissions=True)
def validate_video_link(self):
if self.video_link and "/" in self.video_link:
if self.video_link and "watch?v=" in self.video_link:
self.video_link = self.video_link.split("watch?v=")[-1]
elif self.video_link and "/" in self.video_link:
self.video_link = self.video_link.split("/")[-1]
def validate_status(self):