diff --git a/server/routes.ts b/server/routes.ts index 1adea2f..1c69c94 100644 --- a/server/routes.ts +++ b/server/routes.ts @@ -1284,7 +1284,19 @@ export async function registerRoutes(app: Express): Promise { app.get('/share/video/:id', async (req, res) => { try { const { id } = req.params; - const video = await findVideoByAnyId(id); + + // Find video from cache (not direct Bunny API to avoid 404 errors) + const allVideos = await storage.getVideos(600, 0); + let video; + + // Check if it's a full UUID or short ID + if (id.length === 36 && id.includes('-')) { + video = allVideos.find(v => v.id === id); + } else if (id.length === 8) { + video = allVideos.find(v => v.id.replace(/-/g, '').substring(0, 8) === id); + } else { + video = allVideos.find(v => v.id.includes(id)); + } if (!video) { return res.status(404).send('Video not found');