learned this the hard way running a small scheduler that publishes to users' youtube channels, so writing it down for the next person.

the youtube data api now gives a project 100 video uploads (videos.insert calls) a day by default, next to the 10,000 units for everything else. not 100 per user. 100 total, across every channel that has ever connected to your app, because the quota hangs off your google cloud project and all your users draw from the same pool.

when the pool is empty google answers the upload with a 429, reason uploadLimitExceeded or quotaExceeded, and it stays empty until midnight pacific. three things that were not obvious to me:

  1. the error looks like a per-user problem. the user did nothing wrong, other users' uploads spent the pool. say so in the ui ("today's youtube upload allowance for this app is used up, your video goes out after midnight pacific") instead of "upload failed, try again".

  2. do not retry it. a resumable upload that fails on quota re-streams the whole file on the retry and gets the same 429. mark it retry-after-reset, not retry-now.

  3. the fix is the quota extension audit, not code. the form wants a compliance review of your app, screenshots of every place you show youtube data, and a justification for the number you ask for, and it takes weeks. file it long before the day you need it, at whatever growth rate you have.

if you are building anything that uploads to youtube for more than a handful of people, budget for the audit from day one.

submitted by /u/zubrinovic
[link] [留言]