Add feed type support (all/videos/shorts/live) across API, UI, and scanner#23
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughReplaces template-based YouTube RSS URL construction in get_rss_feed with a call to a new build_youtube_feed_url(channel_id, feed_type=None) helper; get_rss_feed now obtains youtube_rss via that helper. ChangesYouTube RSS Feed URL Generation
Possibly Related PRs
Estimated Code Review Effort🎯 2 (Simple) | ⏱️ ~10 minutes 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 docstrings
🧪 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 |
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…d-separation-r208vu
|
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>
| def build_youtube_feed_url(channel_id: str, feed_type: str = None) -> str: | ||
| """Build a YouTube RSS feed URL for the given channel ID.""" | ||
| return f"https://www.youtube.com/feeds/videos.xml?channel_id={channel_id}" |
There was a problem hiding this comment.
🟡 build_youtube_feed_url ignores feed_type parameter, always returning the unfiltered feed URL
The new build_youtube_feed_url function accepts a feed_type parameter but never uses it — the function body always returns the same generic URL (videos.xml?channel_id=...) regardless of whether feed_type is "shorts", "live", "videos", etc. The comment at the call site (rss_scanner.py:305) explicitly claims it "supports hidden filtered variants for shorts/live", but no such filtering is implemented. As a result, when users request a shorts-only or live-only feed, the youtube_rss URL will be identical to the unfiltered feed, which is misleading and functionally incorrect for filtered feed scenarios.
Prompt for agents
The build_youtube_feed_url function at rss_scanner.py:294-296 accepts a feed_type parameter but completely ignores it in the function body. The comment at the call site (line 305) says it 'supports hidden filtered variants for shorts/live', implying the function should produce different URLs for different feed types. Either implement the feed_type-based URL logic (if YouTube actually supports filtered RSS URLs), or remove the feed_type parameter and fix the misleading comment to accurately describe that the URL is always the same unfiltered feed.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@rss_scanner.py`:
- Line 294: The function build_youtube_feed_url currently declares feed_type as
feed_type: str = None which is an implicit-Optional and flagged by RUF013;
update the signature to use an explicit optional type (either feed_type:
Optional[str] = None with from typing import Optional added to imports, or
feed_type: str | None = None if using Python 3.10+), and since feed_type is
unused in the body consider removing the parameter entirely (and update any
callers) or keep it properly typed; ensure any tests or call sites are adjusted
to match the new signature.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
| xml = fetch_url(feed_url) | ||
| return parse_rss_entries(xml, limit=limit) | ||
|
|
||
| def build_youtube_feed_url(channel_id: str, feed_type: str = None) -> str: |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# First, locate and read the relevant section of rss_scanner.py
fd rss_scanner.py --type fRepository: DisabledAbel/YouTube-RSS-Feed-Scanner
Length of output: 96
🏁 Script executed:
# Read the function around line 294
head -n 310 rss_scanner.py | tail -n 20Repository: DisabledAbel/YouTube-RSS-Feed-Scanner
Length of output: 1057
🏁 Script executed:
# Check Python version requirements from setup.py, pyproject.toml, or similar
fd -e "setup.py" -e "pyproject.toml" -e ".python-version" -e "requirements.txt" --type f | head -5Repository: DisabledAbel/YouTube-RSS-Feed-Scanner
Length of output: 63
🏁 Script executed:
# Search for all calls to build_youtube_feed_url to understand usage
rg "build_youtube_feed_url" -n --context 2Repository: DisabledAbel/YouTube-RSS-Feed-Scanner
Length of output: 762
🏁 Script executed:
# Check for Python version specifications
cat rss_scanner.py | head -30Repository: DisabledAbel/YouTube-RSS-Feed-Scanner
Length of output: 991
🏁 Script executed:
# Look for pyproject.toml or setup.py for Python version requirements
find . -maxdepth 2 -type f \( -name "pyproject.toml" -o -name "setup.py" -o -name "setup.cfg" \) -exec cat {} \;Repository: DisabledAbel/YouTube-RSS-Feed-Scanner
Length of output: 63
🏁 Script executed:
# Check if Optional is imported or if the codebase uses str | None syntax elsewhere
rg "Optional|from typing" rss_scanner.pyRepository: DisabledAbel/YouTube-RSS-Feed-Scanner
Length of output: 63
🏁 Script executed:
# Check the entire function to confirm it doesn't use feed_type anywhere
sed -n '294,300p' rss_scanner.pyRepository: DisabledAbel/YouTube-RSS-Feed-Scanner
Length of output: 493
Fix implicit-Optional type annotation in feed_type.
Line 294 uses feed_type: str = None, which violates PEP 484 typing standards and triggers RUF013. The parameter is also unused in the function body. Change to str | None = None or add Optional[str] = None with a typing import.
-def build_youtube_feed_url(channel_id: str, feed_type: str = None) -> str:
+def build_youtube_feed_url(channel_id: str, feed_type: str | None = None) -> str:🧰 Tools
🪛 Ruff (0.15.12)
[warning] 294-294: PEP 484 prohibits implicit Optional
Convert to T | None
(RUF013)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@rss_scanner.py` at line 294, The function build_youtube_feed_url currently
declares feed_type as feed_type: str = None which is an implicit-Optional and
flagged by RUF013; update the signature to use an explicit optional type (either
feed_type: Optional[str] = None with from typing import Optional added to
imports, or feed_type: str | None = None if using Python 3.10+), and since
feed_type is unused in the body consider removing the parameter entirely (and
update any callers) or keep it properly typed; ensure any tests or call sites
are adjusted to match the new signature.
Motivation
Description
feed_typefrom JSON or query parameters, add route/feed/<feed_type>/<channel_url>with validation and usage response, and passfeed_typethrough torss_scanner.get_rss_feedwhile updating the cache key to userequest.path.Feed Typedropdown (feedType) toindex.html,api/index.html, andtemplates/index.html, includefeed_typein the POST body to/api/feed, and display the selected feed link in the API endpoints area.feed_typesupport toget_rss_feedandget_channel_videos, introducebuild_youtube_feed_urland an HTML ID extractor_extract_video_ids_from_page, map feed types to channel page paths (videos,shorts,streams), and return per-type atom feed paths inapi_endpoints.Testing
Codex Task
Summary by CodeRabbit
Refactor
Chores