Skip to content

Always include official YouTube feeds and preserve channel IDs#28

Merged
DisabledAbel merged 5 commits into
mainfrom
codex/add-official-youtube-feeds-permanently
May 14, 2026
Merged

Always include official YouTube feeds and preserve channel IDs#28
DisabledAbel merged 5 commits into
mainfrom
codex/add-official-youtube-feeds-permanently

Conversation

@DisabledAbel

@DisabledAbel DisabledAbel commented May 14, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Ensure the official YouTube feed URLs are always returned to callers and the frontend so they can be displayed and never lost when generating alternate feeds.
  • Preserve full UC... channel IDs when parsing /channel/... URLs so official feed links are generated correctly.

Description

  • Added build_official_feeds(channel_id, feed_type) in rss_scanner.py which builds and returns official YouTube feed URLs (all, videos, shorts, live, and selected).
  • Updated get_rss_feed(...) in rss_scanner.py to derive youtube_rss from official_feeds['selected'] and to return official_feeds as part of the response tuple.
  • Updated api/app.py to unpack the extended get_rss_feed return value and include official_feeds in the JSON response returned by the /api/feed endpoint.
  • Tightened the channel URL pattern to require the UC prefix in PATTERNS so direct /channel/UC... IDs are preserved intact.

Testing

  • Ran python -m py_compile rss_scanner.py api/app.py to verify syntax compilation (succeeded).
  • Executed rss_scanner.get_rss_feed('https://www.youtube.com/channel/UC_x5XG1OV2P6uZZ5FSM9Ttw', feed_type='live') and verified the returned tuple length and that official_feeds contains the expected keys and URLs (succeeded).
  • Attempted get_rss_feed with a handle URL (e.g. @GoogleDevelopers) but live network fetches failed due to an environment tunnel/proxy 403 Forbidden error, so handle-resolution behavior could not be validated here (network failure, not code error).

Codex Task


Open in Devin Review

Summary by CodeRabbit

  • New Features
    • Official YouTube feeds now render dynamically from available entries.
    • Each official feed has its own "Copy RSS" button to copy the feed URL.
  • Bug Fixes / Improvements
    • Streamlined click handling for copy buttons (delegated event handling).
    • Tighter YouTube channel URL recognition for more accurate parsing.

Review Change Stack

@vercel

vercel Bot commented May 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
you-tube-rss-feed-scanner Ready Ready Preview, Comment May 14, 2026 5:02am

@coderabbitai

coderabbitai Bot commented May 14, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@coderabbitai[bot] has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 54 minutes and 31 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e80f9bf5-4c1d-4fd7-9ddb-fe69236851c4

📥 Commits

Reviewing files that changed from the base of the PR and between 8723ad7 and ebf51a0.

📒 Files selected for processing (1)
  • rss_scanner.py
📝 Walkthrough

Walkthrough

The PR introduces official YouTube feed URLs for channels. The backend generates a dict of feed variants (selected, all, videos, shorts, live) per channel, returns it from get_rss_feed(), API handlers expose it in JSON responses, and the frontend dynamically renders each feed entry with a copy button.

Changes

Official YouTube Feeds

Layer / File(s) Summary
Backend official feeds generation
rss_scanner.py
YouTube channel URL regex updated to match UC... identifiers. New build_official_feeds(channel_id, feed_type) function constructs dict of feed URLs. get_rss_feed() now calls build_official_feeds(), selects the "selected" feed, and returns the official_feeds dict as an additional tuple element. main() unpacking adjusted for the new return value.
API endpoints expose official feeds
api/app.py
/api/feed handler unpacks official_feeds from get_rss_feed() and adds it to the JSON response. /feed/<feed_type>/... handler tuple unpacking adjusted to accommodate the additional return element.
Frontend dynamic official feeds display
api/index.html, templates/index.html, index.html
All three HTML files replace hardcoded official feed key lists with Object.entries(data.official_feeds) loops. Each feed entry now renders as a labeled row with its URL and a per-feed "Copy {key} RSS" button that encodes the URL via encodeURIComponent() in a data-encoded attribute. api/index.html adds a document-level click listener to handle copy button clicks.

Sequence Diagram

sequenceDiagram
  participant main as main()
  participant scanner as get_rss_feed
  participant builder as build_official_feeds
  participant api as /api/feed handler
  participant browser as Browser

  main->>scanner: call(channel_id, feed_type)
  scanner->>builder: build_official_feeds(channel_id, feed_type)
  builder-->>scanner: official_feeds dict
  scanner-->>main: return (..., invidious_rss, api_endpoints, official_feeds)
  main->>api: pass official_feeds
  api->>browser: JSON response includes official_feeds
  browser->>browser: iterate Object.entries(official_feeds) and render rows
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 I nibble URLs with careful paws,
Built feeds for channels — no more flaws,
Backend sorts each official line,
Frontend copies, neat and fine,
RSS hops to clipboard — hooray, fine claws!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly reflects the main objectives: adding official YouTube feeds and preserving channel IDs, which are the core changes across all modified files.
Docstring Coverage ✅ Passed Docstring coverage is 85.71% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/add-official-youtube-feeds-permanently

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

devin-ai-integration[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@coderabbitai

coderabbitai Bot commented May 14, 2026

Copy link
Copy Markdown
Contributor

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Fixes Applied Successfully

Fixed 2 file(s) based on 2 unresolved review comments.

Files modified:

  • api/index.html
  • rss_scanner.py

Commit: 8723ad702141dd0bdac7a6630e60a74b8d5fd92f

The changes have been pushed to the codex/add-official-youtube-feeds-permanently branch.

Time taken: 1m 53s

Fixed 2 file(s) based on 2 unresolved review comments.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
coderabbitai[bot]

This comment was marked as resolved.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

View 7 additional findings in Devin Review.

Open in Devin Review

Comment thread rss_scanner.py
Comment on lines +300 to +311
def build_official_feeds(channel_id: str, feed_type: str = "all") -> dict[str, str]:
"""Return official YouTube feed URLs without duplicating identical links."""
youtube_feed = build_youtube_feed_url(channel_id, feed_type="all")
feeds = {
"youtube": youtube_feed,
"all": build_youtube_feed_url(channel_id, feed_type="all"),
"videos": build_youtube_feed_url(channel_id, feed_type="videos"),
"shorts": build_youtube_feed_url(channel_id, feed_type="shorts"),
"live": build_youtube_feed_url(channel_id, feed_type="live"),
"selected": build_youtube_feed_url(channel_id, feed_type=feed_type),
}
return feeds

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 build_official_feeds returns 6 identical URLs despite claiming to produce distinct feed-type URLs

build_official_feeds (rss_scanner.py:300-311) calls build_youtube_feed_url with different feed_type values ("all", "videos", "shorts", "live", etc.), but build_youtube_feed_url (rss_scanner.py:294-296) completely ignores its feed_type parameter and always returns the same URL (https://www.youtube.com/feeds/videos.xml?channel_id={channel_id}). This means every entry in the returned dict — "youtube", "all", "videos", "shorts", "live", "selected" — is the exact same URL. The UI (all three index.html variants) iterates Object.entries(data.official_feeds) and renders 6 separate rows with different labels ("Official (youtube)", "Official (all)", etc.), each showing the identical URL. The docstring even says "without duplicating identical links" but does the opposite.

Prompt for agents
The function build_official_feeds (rss_scanner.py:300-311) calls build_youtube_feed_url with different feed_type values, but build_youtube_feed_url (rss_scanner.py:294-296) ignores feed_type entirely and always returns the same URL. This results in 6 identical URLs displayed in the UI with different labels, which is misleading.

Two possible approaches:
1. Make build_youtube_feed_url actually produce different URLs per feed_type (if YouTube supports such URLs). Otherwise,
2. Deduplicate the dict in build_official_feeds so it only contains unique URLs. For example, only return a single entry since they're all the same, or collapse entries that share the same value. The docstring already says 'without duplicating identical links' — the implementation should match that contract.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@coderabbitai

coderabbitai Bot commented May 14, 2026

Copy link
Copy Markdown
Contributor

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Fixes Applied Successfully

Fixed 1 file(s) based on 1 unresolved review comment.

Files modified:

  • rss_scanner.py

Commit: ebf51a06bd1e9b78a86964c22987483168d99528

The changes have been pushed to the codex/add-official-youtube-feeds-permanently branch.

Time taken: 1m 21s

Fixed 1 file(s) based on 1 unresolved review comment.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
@DisabledAbel DisabledAbel merged commit da7deb1 into main May 14, 2026
5 checks passed
@DisabledAbel DisabledAbel deleted the codex/add-official-youtube-feeds-permanently branch May 14, 2026 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant