From 755c157466738dda102c939158a0116b972925a3 Mon Sep 17 00:00:00 2001 From: bradautomates Date: Fri, 24 Apr 2026 17:22:51 +1000 Subject: [PATCH] Fix Windows compatibility: encoding, installer hints, interpreter name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - watch.py: drop the ⚠️ emoji from the long-video warning; cp1252 consoles on Windows couldn't encode it and the script crashed. - setup.py: add a Windows branch that prints winget / pip install commands, matching what the README already promised. - SKILL.md: note that Windows users must invoke the scripts with `python`, not `python3` (which is the Microsoft Store stub). Co-Authored-By: Claude Opus 4.7 (1M context) --- .claude-plugin/plugin.json | 2 +- CHANGELOG.md | 9 +++++++++ SKILL.md | 2 ++ scripts/setup.py | 14 ++++++++++++++ scripts/watch.py | 2 +- 5 files changed, 27 insertions(+), 2 deletions(-) diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 72ed32f..b815f76 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "watch", - "version": "0.1.1", + "version": "0.1.2", "description": "Let Claude watch a video. Downloads with yt-dlp, extracts auto-scaled frames with ffmpeg, pulls captions or falls back to Whisper, and hands frames + transcript to Claude so it can answer questions about the video.", "author": { "name": "Bradley Bonanno" diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b79b5b..091e063 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ All notable changes to `/watch` are documented here. +## [0.1.2] — 2026-04-24 + +### Fixed +- Windows console crash: removed the emoji from the long-video warning in `watch.py`; cp1252 consoles couldn't encode it. +- `setup.py` now prints `winget` / `pip` install commands on Windows instead of "unsupported platform" — matches what the README already promised. + +### Changed +- `SKILL.md` notes that on Windows the scripts must be invoked with `python`, not `python3` (the latter is the Microsoft Store stub on Windows). + ## [0.1.1] — 2026-04-24 ### Fixed diff --git a/SKILL.md b/SKILL.md index 34acefd..acd057d 100644 --- a/SKILL.md +++ b/SKILL.md @@ -16,6 +16,8 @@ You don't have a video input; this skill gives you one. A Python script download ## Step 0 — Setup preflight (runs every `/watch` invocation, silent on success) +**Python interpreter:** every `python3 ...` command in this skill is for macOS/Linux. On **Windows**, substitute `python` — the `python3` command on Windows is the Microsoft Store stub and will not run the script. + Before every `/watch` run, verify that dependencies and an API key are in place: ```bash diff --git a/scripts/setup.py b/scripts/setup.py index a82cc1f..308f6b3 100755 --- a/scripts/setup.py +++ b/scripts/setup.py @@ -186,6 +186,16 @@ def _install_hint_linux(missing: list[str]) -> str: return "\n ".join(hints) if hints else "nothing to install" +def _install_hint_windows(missing: list[str]) -> str: + pkgs = _brew_pkg(missing) + hints = [] + if "ffmpeg" in pkgs: + hints.append("winget: `winget install Gyan.FFmpeg`") + if "yt-dlp" in pkgs: + hints.append("winget: `winget install yt-dlp.yt-dlp` or pip: `pip install --user yt-dlp`") + return "\n ".join(hints) if hints else "nothing to install" + + def _status() -> dict: """Structured preflight snapshot.""" missing = _check_binaries() @@ -268,6 +278,10 @@ def cmd_install() -> int: print("[setup] dependencies missing on Linux — please install:", file=sys.stderr) print(" " + _install_hint_linux(missing), file=sys.stderr) return 2 + elif system == "Windows": + print("[setup] dependencies missing on Windows — please install:", file=sys.stderr) + print(" " + _install_hint_windows(missing), file=sys.stderr) + return 2 else: print(f"[setup] unsupported platform ({system}) for auto-install. Install manually:", file=sys.stderr) print(f" missing: {', '.join(missing)}", file=sys.stderr) diff --git a/scripts/watch.py b/scripts/watch.py index d802279..8aa0600 100755 --- a/scripts/watch.py +++ b/scripts/watch.py @@ -177,7 +177,7 @@ def main() -> int: mins = int(full_duration // 60) print() print( - f"> ⚠️ This is a {mins}-minute video. Frame coverage is sparse at this length — " + f"> **Warning:** This is a {mins}-minute video. Frame coverage is sparse at this length — " "accuracy degrades noticeably on anything over 10 minutes. For better results, " "re-run with `--start HH:MM:SS --end HH:MM:SS` to zoom into a specific section." )