open-webui / src /routes /watch /+page.svelte
github-actions[bot]
GitHub deploy: 2b7e3a192dcfe6dad80ac5087f05e320e8ee8fa0
25dceb2
raw
history blame
543 Bytes
<script>
import { onMount } from 'svelte';
import { goto } from '$app/navigation';
onMount(() => {
// Get the current URL search parameters
const params = new URLSearchParams(window.location.search);
// Check if 'v' parameter exists
if (params.has('v')) {
// Get the value of 'v' parameter
const videoId = params.get('v');
// Redirect to root with 'youtube' parameter
goto(`/?youtube=${encodeURIComponent(videoId)}`);
} else {
// Redirect to root if 'v' parameter doesn't exist
goto('/');
}
});
</script>