Index: frontend/src/components/Sidebar.tsx
===================================================================
--- frontend/src/components/Sidebar.tsx	(revision 8ccb07eaee0e86c4db97ef4fa7b747503a6fc43d)
+++ frontend/src/components/Sidebar.tsx	(revision 1579b4f9eaf503a14012d471db11e16e645306e3)
@@ -5,23 +5,5 @@
 import { usePlayer } from "../context/playerContext";
 import type { BasicPlaylist, BasicSong, SidebarProps } from "../utils/types";
-
-const toEmbedUrl = (url: string): string => {
-	try {
-		const parsed = new URL(url);
-		if (
-			(parsed.hostname === "www.youtube.com" ||
-				parsed.hostname === "youtube.com") &&
-			parsed.searchParams.has("v")
-		) {
-			return `https://www.youtube.com/embed/${parsed.searchParams.get("v")}`;
-		}
-		if (parsed.hostname === "youtu.be") {
-			return `https://www.youtube.com/embed${parsed.pathname}`;
-		}
-		return url;
-	} catch {
-		return url;
-	}
-};
+import { toEmbedUrl } from "../utils/utils";
 
 const Sidebar = ({ isOpen, onClose }: SidebarProps) => {
