import videodb
conn = videodb.connect(api_key="your_api_key")
coll = conn.get_collection()
video = coll.get_videos()[0]
# Get full stream URL (returns existing if available)
stream_url = video.generate_stream()
# Create stream from custom timeline (in seconds)
# Format: [(start, end), (start, end), ...]
timeline = [(0, 30), (60, 90)]
custom_stream_url = video.generate_stream(timeline=timeline)
print(f"Stream URL: {stream_url}")
print(f"Custom stream: {custom_stream_url}")