Open-source social media scheduler built for AI agents and the teams behind them. Create, schedule and publish posts to every network through MCP or the REST API, or write them yourself in a composer your team will love.
PHP ai-agentsblueskyfacebookinstagramlaravellinkedinmastodonmcpmcp-serveropen-sourcerest-apiself-hostedsocial-mediasocial-media-managementsocial-media-schedulerthreadstiktokvuejsxyoutube
Drop the internal daily cap on YouTube analytics jobs (#402)
Paulo Castellano7b9eeec9c68a
diff --git a/app/Support/Analytics/AnalyticsRateLimits.php b/app/Support/Analytics/AnalyticsRateLimits.phpindex 7b73a376c..83d70754c 100644--- a/app/Support/Analytics/AnalyticsRateLimits.php+++ b/app/Support/Analytics/AnalyticsRateLimits.php@@ -19,9 +19,10 @@ use Illuminate\Cache\RateLimiting\Limit;* documented ceiling:* - X: GET /2/users/:id/tweets allows 10,000 requests per 15 minutes per app (~666/min); guard 600/min.* - TikTok: 600 requests per minute per endpoint; guard 500/min.- * - YouTube: the Data API quota is 10,000 units a day per Google Cloud project, shared with publishing.- * An analytics job spends at most 2 units (playlistItems + a 50-id videos.list), so 3,000 jobs a day- * stay under 6,000 units and leave the rest for uploads.+ * - YouTube has no shared guard. A metrics job reads `videos.list` in batches of 50 ids (one Data API+ * unit for 50 videos) and one YouTube Analytics API report; uploads have their own quota. A+ * `quotaExceeded` or 429 from Google is retried as rate_limited, and more quota is requested from+ * Google when that happens.* - Bluesky: a PDS allows 3,000 requests per 5 minutes per IP over all endpoints (600/min,* docs.bsky.app "Rate Limits", `global-ip` in @atproto/pds rate-limits.ts), shared with publishing* through the same host; guard 500/min per PDS host. The public AppView documents no number.@@ -56,7 +57,6 @@ class AnalyticsRateLimitsreturn match ($account->platform) {Platform::X => Limit::perMinute(600)->by("{$network}:app"),Platform::TikTok => Limit::perMinute(500)->by("{$network}:app"),- Platform::YouTube => Limit::perDay(3000)->by("{$network}:project"),Platform::Bluesky => Limit::perMinute(500)->by("{$network}:pds:".parse_url((string) data_get($account->meta, 'service', config('trypost.platforms.bluesky.default_service')), PHP_URL_HOST)),Platform::Mastodon => Limit::perMinute(50)->by("{$network}:instance:{$account->mastodonInstance()}"),default => null,diff --git a/tests/Feature/Analytics/PublicationMetricsJobsTest.php b/tests/Feature/Analytics/PublicationMetricsJobsTest.phpindex 5b94c7a3d..4232ec09e 100644--- a/tests/Feature/Analytics/PublicationMetricsJobsTest.php+++ b/tests/Feature/Analytics/PublicationMetricsJobsTest.php@@ -308,7 +308,7 @@ test('analytics jobs are rate limited per account with a shared guard only where'instagram is limited per token' => [Platform::Instagram, null],'facebook is limited per page token' => [Platform::Facebook, null],'x shares the app limit' => [Platform::X, 'x:app'],- 'youtube shares the project quota' => [Platform::YouTube, 'youtube:project'],+ 'youtube is limited only per channel' => [Platform::YouTube, null],'tiktok shares the app limit' => [Platform::TikTok, 'tiktok:app'],]);