handle Vimeo intro URLs without import failure

Normalize Vimeo page URLs to embed URLs for intro video fields instead of forcing /files/upload URL import that can fail behind verification gates.

Made-with: Cursor
This commit is contained in:
Yared Yemane 2026-04-08 02:11:34 -07:00
parent cb2a6843a3
commit 42bb74c15c

View File

@ -249,6 +249,13 @@ export function AddNewPracticePage() {
const handleImportIntroVideoFromUrl = async () => {
const source = introVideoUrl.trim()
if (!source || !/^https?:\/\//i.test(source)) return
const vimeoEmbed = toVimeoEmbedUrl(source)
// Vimeo page URLs can be protected by anti-bot checks when server-side fetched.
// For those links, prefer local normalization to player URL instead of failing import.
if (vimeoEmbed) {
setIntroVideoUrl(vimeoEmbed)
return
}
setImportingIntroVideoUrl(true)
try {