Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions rss_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,15 +291,19 @@ def read_feed(feed_url: str, limit: int = 10) -> list[dict]:
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.

"""Build a YouTube RSS feed URL for the given channel ID."""
return f"https://www.youtube.com/feeds/videos.xml?channel_id={channel_id}"
Comment on lines +294 to +296

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.


def get_rss_feed(url: str, include_api_endpoints: bool = False, base_url: str = "http://localhost:8080", feed_type: str = "all") -> tuple:
"""Get RSS feed data for a YouTube channel.

Returns: (youtube_rss, channel_id, channel_name, atom_feed, video_count, invidious_rss, api_endpoints)
"""
channel_id, channel_name = extract_channel_id(url)

# YouTube's native RSS URL (mostly broken but included for reference)
youtube_rss = YOUTUBE_RSS_TEMPLATE.format(channel_id=channel_id)
# YouTube RSS URL (supports hidden filtered variants for shorts/live)
youtube_rss = build_youtube_feed_url(channel_id, feed_type=feed_type)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.

# Try to get videos from the selected YouTube channel page
videos = get_channel_videos(channel_id, feed_type=feed_type)
Expand Down