Skip to content

Serve the latest YouTube uploads at /api/videos - #524

Open
shanerbaner82 wants to merge 1 commit into
mainfrom
feat/videos-api
Open

shanerbaner82 wants to merge 1 commit into
mainfrom
feat/videos-api

Conversation

@shanerbaner82

Copy link
Copy Markdown
Contributor

Why

The Jump app's Videos tab loads the YouTube channel RSS feed (youtube.com/feeds/videos.xml?channel_id=…). That endpoint now returns 404 for every channel, so the tab shows "Unable to load videos". This gives the app a source we control.

What

GET /api/videos: public, throttled to 60/min, Cache-Control: public, max-age=900.

{ "data": [ { "id", "title", "description", "published_at", "thumbnail", "url" } ] }
  • YouTubeVideoService reads the uploads playlist for @NativePHPOfficial (UUbkAE6vLlR6lOy_nxd--22g) through the YouTube Data API v3 playlistItems endpoint: the latest 25, with private and deleted uploads dropped.
  • The list is cached for an hour. The last successful list is also kept forever, so if YouTube fails or the quota runs out the endpoint serves slightly stale videos instead of an empty list.
  • Each refresh costs 1 unit of API quota (the default daily quota is 10,000).

Deploy

Set YOUTUBE_API_KEY in production: a Google Cloud API key with the YouTube Data API v3 enabled. Without it the endpoint returns {"data": []} and makes no request. YOUTUBE_CHANNEL_ID is optional and defaults to @NativePHPOfficial.

Tests

tests/Feature/Api/VideosTest.php covers mapping, caching, the stale fallback, and the missing-key case.

🤖 Generated with Claude Code

The Jump app's Videos tab read the channel RSS feed at youtube.com/feeds,
which now returns 404 for every channel. Serve the list from here instead,
via the YouTube Data API's uploads playlist for @NativePHPOfficial.

Cached for an hour; the last good list is kept so a YouTube failure serves
stale videos rather than an empty tab. Needs YOUTUBE_API_KEY; without it
the endpoint returns an empty list and makes no request.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 19, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: a6972185-7465-4338-8530-31529885daf1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants