Add Gemini-backed multi-channel video watcher#2
Add Gemini-backed multi-channel video watcher#2Timon0512 wants to merge 9 commits intocheck_for_new_videosfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting
new_video_check.py
Outdated
| # Default command: check | ||
| api_key = getattr(args, "api_key", None) or os.getenv("GEMINI_API_KEY") | ||
| if not api_key: | ||
| raise SystemExit("Gemini API key missing. Provide via --api-key or GEMINI_API_KEY env var.") | ||
|
|
||
| check_for_new_videos(api_key=api_key, channel_ids=getattr(args, "channels", None), limit=args.limit) |
There was a problem hiding this comment.
Guard default CLI path when subcommand options are absent
The parser sets command to "check" by default, but when the script is run without an explicit subcommand the check subparser never runs and its arguments (limit, channels, etc.) are not attached to args. The subsequent call to check_for_new_videos(..., limit=args.limit) therefore raises AttributeError: 'Namespace' object has no attribute 'limit' as soon as GEMINI_API_KEY is present. Running GEMINI_API_KEY=dummy python new_video_check.py reproduces the crash. Access these attributes via getattr with defaults or explicitly invoke the check subparser to keep the default command functional.
Useful? React with 👍 / 👎.
Summary
Testing
https://chatgpt.com/codex/tasks/task_e_68e9fa899ea083219777ee2d8a865775