Skip to content

Remove keyword filter from YouTube digest#4

Merged
MetzinAround merged 2 commits into
mainfrom
MetzinAround/remove-youtube-keyword-filter
May 14, 2026
Merged

Remove keyword filter from YouTube digest#4
MetzinAround merged 2 commits into
mainfrom
MetzinAround/remove-youtube-keyword-filter

Conversation

@MetzinAround
Copy link
Copy Markdown
Contributor

What changed

The YouTube weekly digest no longer filters by keywords. It now fetches any video posted in the past 7 days from the configured channel, ranks them by view count, and posts the top results.

Why

Keyword filtering was causing the digest to return zero results — either because the API key was invalid (giving an error) or because recent videos didn't match the keyword list. Removing the filter ensures the digest always has content to post as long as the channel has uploaded anything that week.

Files changed

  • utils/youtube_api.py — replaced search_by_keywords / get_top_videos_by_keywords with search_recent / get_top_recent_videos (no q param sent to the API)
  • bot/cogs/youtube_watcher.py — removed keywords config dependency; updated embed to drop the Topics line
  • config/config.yaml — removed keywords list from youtube: section
  • tests/test_youtube_api.py + tests/test_cog_flows.py — updated to match new method names

The YouTube digest now fetches any video posted in the past 7 days
from the configured channel, rather than filtering by topic keywords.
This avoids empty digests caused by keyword mismatches.

Changes:
- Replace search_by_keywords/get_top_videos_by_keywords with
  search_recent/get_top_recent_videos in youtube_api.py (no q param)
- Remove keywords config and _DEFAULT_KEYWORDS from youtube_watcher.py
- Update embed description to drop the Topics line
- Remove keywords from youtube section of config.yaml
- Update all tests to use the new method names

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes keyword filtering from the YouTube weekly digest so the bot ranks recent videos from the configured YouTube channel by view count instead of filtering by configured topics.

Changes:

  • Replaced keyword-based YouTube API methods with recent-video methods that omit the q parameter.
  • Updated the YouTube watcher flow and embed builder to remove keyword dependencies.
  • Removed YouTube keywords from config and updated related tests.
Show a summary per file
File Description
utils/youtube_api.py Adds unfiltered recent-video search and ranking methods.
bot/cogs/youtube_watcher.py Uses the new YouTube API methods and removes topic display from embeds.
config/config.yaml Removes the YouTube keyword list and updates search pool wording.
tests/test_youtube_api.py Updates YouTube API tests for the new method names and no q parameter.
tests/test_cog_flows.py Updates the fake YouTube client/config for unfiltered digest flow.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 5/5 changed files
  • Comments generated: 2

Comment thread bot/cogs/youtube_watcher.py
Comment thread bot/cogs/youtube_watcher.py
@MetzinAround MetzinAround merged commit 631fd4f into main May 14, 2026
1 check passed
@MetzinAround MetzinAround deleted the MetzinAround/remove-youtube-keyword-filter branch May 14, 2026 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants