Lesson 4 of 16
40. Design Video Upload and Streaming (YouTube)

40.3 What are the doors?

3 min read+10 XP

Step 3: API and data model (10 minutes)

POST /v1/videos { "title": "...", "size": 2000000000 } returns: { "video_id": "v77", "upload_url": "https://upload…/v77?sig=…", "chunk_size": 8000000 } PUT <upload_url> (resumable: Content-Range per chunk; GET returns what's received so far) POST /v1/videos/v77/complete → 202 { "status": "processing" } GET /v1/videos/v77 → { "status": "ready", "title": "...", "playlist": "https://cdn…/v77/master.m3u8", "views": 18213 } POST /v1/videos/v77/view { "watched_s": 45, "session": "…" } (sent by the player)