Problem
shortube/upload.py makes a single attempt to upload. A transient YouTube API 5xx (or rate-limit 429) aborts the whole pipeline with an UploadError even though the upload would succeed a moment later.
Task
Add a bounded retry with exponential backoff around the upload request (e.g. 3 attempts, 2s/4s backoff), only for transient statuses (429, 5xx). Keep permanent errors (403, 401, quota) failing immediately.
Acceptance criteria
Files
shortube/upload.py
tests/test_upload.py
Problem
shortube/upload.pymakes a single attempt to upload. A transient YouTube API5xx(or rate-limit429) aborts the whole pipeline with anUploadErroreven though the upload would succeed a moment later.Task
Add a bounded retry with exponential backoff around the upload request (e.g. 3 attempts, 2s/4s backoff), only for transient statuses (
429,5xx). Keep permanent errors (403,401, quota) failing immediately.Acceptance criteria
youtube.videos().insert()call)tests/test_upload.pystill passFiles
shortube/upload.pytests/test_upload.py