import { NextResponse, NextRequest } from "next/server" import { getVideo } from "@/app/api/actions/ai-tube-hf/getVideo" import { parseMediaProjectionType } from "@/lib/utils/parseMediaProjectionType"; export async function GET(req: NextRequest) { const mediaId = req.url.split("/").pop() || "" const media = await getVideo({ videoId: mediaId, neverThrow: true }) if (!media) { return new NextResponse("media not found", { status: 404 }); } const isEquirectangular = parseMediaProjectionType(media) === "equirectangular" const html = ` ${media.label} - AiTube ${ isEquirectangular ? ` ` : ` ` } ` return new NextResponse(html, { status: 200, headers: new Headers({ "content-type": "text/html" }), }) }