Always include official YouTube feeds and preserve channel IDs#28
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded
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 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. 📝 WalkthroughWalkthroughThe 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 ChangesOfficial YouTube Feeds
Sequence DiagramsequenceDiagram
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Fixes Applied SuccessfullyFixed 2 file(s) based on 2 unresolved review comments. Files modified:
Commit: The changes have been pushed to the Time taken: |
Fixed 2 file(s) based on 2 unresolved review comments. Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
| 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 |
There was a problem hiding this comment.
🟡 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.
Was this helpful? React with 👍 or 👎 to provide feedback.
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Fixes Applied SuccessfullyFixed 1 file(s) based on 1 unresolved review comment. Files modified:
Commit: The changes have been pushed to the Time taken: |
Fixed 1 file(s) based on 1 unresolved review comment. Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
Motivation
UC...channel IDs when parsing/channel/...URLs so official feed links are generated correctly.Description
build_official_feeds(channel_id, feed_type)inrss_scanner.pywhich builds and returns official YouTube feed URLs (all,videos,shorts,live, andselected).get_rss_feed(...)inrss_scanner.pyto deriveyoutube_rssfromofficial_feeds['selected']and to returnofficial_feedsas part of the response tuple.api/app.pyto unpack the extendedget_rss_feedreturn value and includeofficial_feedsin the JSON response returned by the/api/feedendpoint.UCprefix inPATTERNSso direct/channel/UC...IDs are preserved intact.Testing
python -m py_compile rss_scanner.py api/app.pyto verify syntax compilation (succeeded).rss_scanner.get_rss_feed('https://www.youtube.com/channel/UC_x5XG1OV2P6uZZ5FSM9Ttw', feed_type='live')and verified the returned tuple length and thatofficial_feedscontains the expected keys and URLs (succeeded).get_rss_feedwith a handle URL (e.g.@GoogleDevelopers) but live network fetches failed due to an environment tunnel/proxy403 Forbiddenerror, so handle-resolution behavior could not be validated here (network failure, not code error).Codex Task
Summary by CodeRabbit