Skip to content

Video: use local files; return local URL in status; remove /by-job#107

Closed
apensotti wants to merge 9 commits into
mainfrom
video-gen-tool-fix
Closed

Video: use local files; return local URL in status; remove /by-job#107
apensotti wants to merge 9 commits into
mainfrom
video-gen-tool-fix

Conversation

@apensotti
Copy link
Copy Markdown
Member

Problem

  • Expiring provider URLs caused 404s like: “The video is no longer available. Downloads expire after 1 hours.”

Solution

  • Save generated videos locally and prefer local file URLs in chat.
  • Enrich GET /api/v1/videos/sora2/{id}/status to include { url, fileId } when a local asset exists.
  • Update VideoJob to consume data.url from status and finalize only when needed.
  • Update ChatMessages to ignore remote video URLs and render via VideoJob (resolves local files).
  • Remove /api/v1/videos/sora2/by-job/{id} endpoint.

Security & Docs

  • Re-authorizes on every API call.
  • No secrets exposed to clients; only local file URLs returned.
  • No GET mutations; finalize remains POST-only.
  • Swagger tags present; response now includes url/fileId (follow-up: extend schema fields).

Files

  • app/api/v1/videos/sora2/[id]/status/route.ts (+ local url lookup)
  • components/ai/video.tsx (prefer status url; remove /by-job)
  • components/chat/chat-messages.tsx (prefer local url; fallback to VideoJob)
  • app/api/v1/videos/sora2/by-job/[id]/route.ts (deleted)

Testing

  • Generated video renders from /files/... without expiring.

@apensotti apensotti closed this Nov 3, 2025
@apensotti apensotti deleted the video-gen-tool-fix branch November 3, 2025 03:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant