Skip to content

Add feed type support (all/videos/shorts/live) across API, UI, and scanner#23

Merged
DisabledAbel merged 4 commits into
mainfrom
codex/add-youtube-feed-separation-r208vu
May 14, 2026
Merged

Add feed type support (all/videos/shorts/live) across API, UI, and scanner#23
DisabledAbel merged 4 commits into
mainfrom
codex/add-youtube-feed-separation-r208vu

Conversation

@DisabledAbel

@DisabledAbel DisabledAbel commented May 14, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Allow selecting specific YouTube feed types (combined, videos, shorts, live) and expose explicit endpoints and UI controls for each type.
  • Make generated API endpoint links reflect the selected feed type so consumers can fetch the exact feed they need.

Description

  • API: accept and validate feed_type from JSON or query parameters, add route /feed/<feed_type>/<channel_url> with validation and usage response, and pass feed_type through to rss_scanner.get_rss_feed while updating the cache key to use request.path.
  • UI/templates: add a Feed Type dropdown (feedType) to index.html, api/index.html, and templates/index.html, include feed_type in the POST body to /api/feed, and display the selected feed link in the API endpoints area.
  • Scanner: add feed_type support to get_rss_feed and get_channel_videos, introduce build_youtube_feed_url and 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 in api_endpoints.

Testing

  • No automated tests were run.

Codex Task


Open in Devin Review

Summary by CodeRabbit

  • Refactor

    • Internal update to how YouTube RSS feed URLs are constructed; no change to user-facing behavior.
  • Chores

    • Small code adjustments to centralize URL construction, preparing for future feed-type variations without affecting current feeds.

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 3:46am

@coderabbitai

coderabbitai Bot commented May 14, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Replaces 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.

Changes

YouTube RSS Feed URL Generation

Layer / File(s) Summary
Dynamic feed URL generation
rss_scanner.py
Adds `build_youtube_feed_url(channel_id: str, feed_type: str

Possibly Related PRs

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A helper hops in, neat and spry,
It builds the feed URL by and by.
No more templates stitched in place—
Channels and types now find their space.
Hooray, the scanner’s nimbler pace!

🚥 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 PR title 'Add feed type support (all/videos/shorts/live) across API, UI, and scanner' accurately describes the main changes. The raw_summary shows modifications to rss_scanner.py with new helper function build_youtube_feed_url and updated call sites, which aligns with the broader PR objective of adding feed type support across multiple components. The title is specific, clear, and directly reflects the primary goal.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% 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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/add-youtube-feed-separation-r208vu

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[bot]

This comment was marked as resolved.

Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
coderabbitai[bot]

This comment was marked as resolved.

devin-ai-integration[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 1 file(s) based on 1 unresolved review comment.

Files modified:

  • rss_scanner.py

Commit: 77bc2336ff63b68f2652eb8ad486f222a538fcb2

The changes have been pushed to the codex/add-youtube-feed-separation-r208vu branch.

Time taken: 1m 55s

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

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>

@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 3 additional findings in Devin Review.

Open in Devin Review

Comment thread rss_scanner.py
Comment on lines +294 to +296
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}"

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_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.
Open in Devin Review

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

@coderabbitai coderabbitai 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.

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 238929ee-d1c8-4b9b-92f8-cbf921d09585

📥 Commits

Reviewing files that changed from the base of the PR and between 76173a2 and 77bc233.

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

Comment thread rss_scanner.py
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:

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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

# First, locate and read the relevant section of rss_scanner.py
fd rss_scanner.py --type f

Repository: 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 20

Repository: 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 -5

Repository: 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 2

Repository: DisabledAbel/YouTube-RSS-Feed-Scanner

Length of output: 762


🏁 Script executed:

# Check for Python version specifications
cat rss_scanner.py | head -30

Repository: 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.py

Repository: 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.py

Repository: 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.

@DisabledAbel DisabledAbel merged commit 0061ee6 into main May 14, 2026
5 checks passed
@DisabledAbel DisabledAbel deleted the codex/add-youtube-feed-separation-r208vu branch May 14, 2026 03:49
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