Remove keyword filter from YouTube digest#4
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
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
qparameter. - 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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— replacedsearch_by_keywords/get_top_videos_by_keywordswithsearch_recent/get_top_recent_videos(noqparam sent to the API)bot/cogs/youtube_watcher.py— removedkeywordsconfig dependency; updated embed to drop the Topics lineconfig/config.yaml— removedkeywordslist fromyoutube:sectiontests/test_youtube_api.py+tests/test_cog_flows.py— updated to match new method names