Video download API for Fetchy iOS app using yt-dlp, migrated to Vercel and Supabase.
- Vercel: Handles API requests and
yt-dlpexecution (Node.js). - Supabase Database: Stores job status and logs.
- Supabase Storage: Stores downloaded video files.
-
Supabase Setup:
- Create a new project on Supabase.
- Create a table named
jobswith the following columns:id: int8 (Identity)status: textprogress: float8message: texttitle: textfile_path: textlog: texturl: textcreated_at: timestamptz (default: now())
- Create a storage bucket named
downloads(set it to public or private as needed).
-
Environment Variables: Copy
.env.exampleto.envand fill in your Supabase credentials. -
Install Dependencies:
npm install- Install Vercel CLI:
npm i -g vercel - Deploy:
vercel - Add Environment Variables in Vercel Dashboard:
SUPABASE_URLSUPABASE_SERVICE_ROLE_KEYSUPABASE_BUCKET_NAME(optional, defaults todownloads)
Start a download job.
Request:
{
"url": "https://youtube.com/watch?v=...",
"quality": "1080p"
}Get job status and progress.
Redirects to a signed URL for the completed file.
Get raw yt-dlp log output.