mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-09-21 14:09:17 +02:00
support youtu.be links
This commit is contained in:
@@ -21,7 +21,8 @@ export function renderYoutubeUrl(match: URL) {
|
|||||||
|
|
||||||
const { youtubeRedirect } = appSettings.value;
|
const { youtubeRedirect } = appSettings.value;
|
||||||
|
|
||||||
const videoId = match.searchParams.get("v");
|
var videoId = match.searchParams.get("v");
|
||||||
|
if (match.hostname === "youtu.be") videoId = match.pathname.split("/")[1];
|
||||||
if (!videoId) throw new Error("cant find video id");
|
if (!videoId) throw new Error("cant find video id");
|
||||||
const embedUrl = new URL(`/embed/${videoId}`, youtubeRedirect || "https://youtube.com");
|
const embedUrl = new URL(`/embed/${videoId}`, youtubeRedirect || "https://youtube.com");
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user