Skip to content

Instantly share code, notes, and snippets.

@mrtj
mrtj / stream_to_s3.py
Last active February 8, 2025 22:36
Download a file and stream it directly to an #aws S3 bucket without saving it locally
#!/usr/bin/env python3
import boto3
import requests
import tqdm
from urllib.parse import urlparse
def stream_to_s3(
source_url,
target_url,