Download YouTube Videos Straight to S3, GCS or R2
Option 1: yt-dlp, then upload
The DIY route is two steps — download locally, then push to your bucket:
yt-dlp -f "bv*+ba/b" -o "%(id)s.%(ext)s" -a urls.txt
aws s3 cp . s3://your-bucket/youtube/ --recursive --exclude "*" --include "*.mp4"
yt-dlp -f "bv*+ba/b" -o "%(id)s.%(ext)s" -a urls.txt
gcloud storage cp *.mp4 gs://your-bucket/youtube/
This is fine for small jobs. At scale the problems stack up: every file lands on your server first (disk + egress), uploads fail and need their own retries, and you're back to managing proxies and rate limits on the download side. See the yt-dlp at scale breakdown.
Option 2: deliver straight to the bucket
VideoDL can write finished files straight into your own storage, so nothing passes through your server and there's no separate upload step. You connect the destination once in the dashboard, under Upload Settings, and every API job after that is delivered there. The request itself doesn't change:
curl -X POST "https://api.videodl.app/api/start-download" \
-H "X-API-Key: $VIDEODL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://www.youtube.com/watch?v=VIDEO_ID", "resolution": "1080"}'
When the job finishes, the status response gives a signed link to the file in your bucket, valid for 7 days. The file itself stays in your bucket for as long as you keep it. Without a destination, files are served from a temporary link that expires after about an hour.
What each destination needs
| Destination | Fields in Upload Settings |
|---|---|
| Amazon S3 | Bucket, region, access key ID, secret access key, optional path prefix |
| Google Cloud Storage | Bucket, region, HMAC access key and secret (Cloud Storage → Settings → Interoperability), optional path prefix |
| Cloudflare R2 | S3-compatible: endpoint https://ACCOUNT_ID.r2.cloudflarestorage.com, bucket, R2 access key and secret, optional prefix |
| Backblaze B2, MinIO, Alibaba OSS | S3-compatible: your provider's S3 endpoint URL, bucket, keys, optional prefix |
| Google Drive | Click Connect and sign in. Optionally name a folder or paste a folder share link. Shared Drives work, and missing folders are created |
Test & Save checks the connection before saving: it writes a small test object under your prefix, reads it back and deletes it. If something's wrong, it tells you which part, such as a wrong region, a missing bucket or denied access.
Give the key only what it needs
Create a dedicated access key for VideoDL instead of reusing an admin key. On S3, this policy is enough. It allows writing, reading and deleting objects under one prefix and nothing else:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["s3:PutObject", "s3:GetObject", "s3:DeleteObject"],
"Resource": "arn:aws:s3:::your-bucket/youtube/*"
}
]
}
Set the path prefix in Upload Settings to youtube to match. For R2, create an API token scoped to the one bucket with object read and write. For GCS, use HMAC keys for a service account with access to just that bucket. You can rotate or revoke the key at any time, and new jobs stop being delivered until you save a new one.
Which cloud should you pick?
| Destination | Best when | Egress |
|---|---|---|
| Amazon S3 | You're already on AWS | Charged |
| Google Cloud Storage | You're on GCP / using Vertex | Charged |
| Cloudflare R2 | You read the data back often | None |
If you'll repeatedly pull the videos back out (training runs, re-processing), R2's zero egress can save more than the storage costs. If your pipeline already lives in one cloud, keep the data next to your compute.
Keep files aligned
Whichever route you use, name files by video ID (%(id)s) so the video, its transcript, and metadata stay tied to the same key. This matters most for AI datasets, where drift between modalities quietly corrupts training pairs.
FAQ
Can I download YouTube videos directly to S3?
Yes. Either download with yt-dlp and upload each file to S3 yourself, or use a managed download API that writes results straight to your S3 bucket, skipping the intermediate hop through your own server.
Why deliver straight to the cloud instead of downloading first?
Direct-to-cloud delivery avoids paying to move terabytes through your own server, keeps files organized by ID, and removes a whole class of disk-space and upload-failure problems at scale.
Which clouds are supported?
Amazon S3, Google Cloud Storage, Google Drive, and S3-compatible storage such as Cloudflare R2, Backblaze B2, MinIO and Alibaba OSS.
Straight to your bucket
Connect S3, GCS, R2 or Google Drive once, and every download lands in your storage. Free trial included.
Keep reading
All articles →
Run bulk downloads within rate limits
Send hundreds of YouTube downloads through an API without 429 errors: plan by rate limit, queue locally, poll politely and log results. Tested Python script.
How to download YouTube videos with an API
A developer's guide to downloading YouTube videos with an API — cURL, Python and Node examples, plus DIY yt-dlp vs a managed API.
The best yt-dlp alternative for scale
yt-dlp alternatives compared: youtube-dl, hosted download APIs and managed services, with real prices. When yt-dlp is still the right tool, and when to switch.