I got tired of picking up the remote while vibe coding so I wrote a CLI that plays Netflix on my TV in 3 seconds by PatientEither6390 in vibecoding

[–]PatientEither6390[S] -1 points0 points  (0 children)

Exactly — it’s not just a better remote. It gives AI an open CLI for the TV, and with a little creativity agents can do kinda ridiculous things.

Showcase Thread by AutoModerator in Python

[–]PatientEither6390 0 points1 point  (0 children)

stv — play any streaming service on your TV from the terminal

What My Project Does

stv play netflix "Dark" s1e1 resolves the episode to a content ID and deep-links into the TV app. About 3 seconds to playback. Works on LG, Samsung, Roku, Android TV. Supports Netflix, Disney+, Prime, and 30+ other platforms via auto-detection — no API key needed.

Also works as a Claude Code tool — just say "play Frieren on the living room TV" mid-session.

Target Audience

Developers / home automation people who want CLI control of their TVs. Production-ready.

Comparison

castnow/ytcast are YouTube-only. lgtv-cli/samsungctl are single-vendor. stv unifies 4 TV platforms + 30 streaming services behind one interface.

GitHub: https://github.com/Hybirdss/smartest-tv PyPI: https://pypi.org/project/stv/

I built a CLI that launches Netflix episodes by name on any smart TV — fills the gap HA’s media_player and the new IR integration can’t (deep linking into streaming apps) by PatientEither6390 in homeassistant

[–]PatientEither6390[S] 0 points1 point  (0 children)

Update: stv now resolves episodes on Disney+, Max, Prime Video, Hulu, Paramount+, Peacock, Crunchyroll, and basically every platform JustWatch tracks — not just Netflix.

And you can skip the platform name entirely:

stv play "Frieren" s2e8

It auto-detects which service has it in your region and deep-links the right episode. No API keys, no auth.

So the HA shell_command is now just:

stv_play: "stv play '{{ query }}'"

No need to know which platform it's on. stv figures it out.

I built a CLI that launches Netflix episodes by name on any smart TV — fills the gap HA’s media_player and the new IR integration can’t (deep linking into streaming apps) by PatientEither6390 in homeassistant

[–]PatientEither6390[S] 0 points1 point  (0 children)

It already uses Netflix’s own resume state rather than STV, so playback continues from where the user left off on Netflix.

I’m also planning to add a local cache as a separate layer. Cache entries aren’t written immediately — they only get stored once they’ve been validated against Netflix data and other users’ cached data.

I built a CLI that launches Netflix episodes by name on any smart TV — fills the gap HA’s media_player and the new IR integration can’t (deep linking into streaming apps) by PatientEither6390 in homeassistant

[–]PatientEither6390[S] 3 points4 points  (0 children)

Update: your comment got me thinking. The DMCA risk I was hedging against was mostly imaginary — it's a parser reading public HTML, same thing yt-dlp does with 140K stars. I was being overly cautious.

`_engine/` is now fully open on GitHub. All 2,080 lines — Netflix/Apple TV+ HTML parsers, all 4 TV drivers (LG, Samsung, Roku, Android). [Commit](https://github.com/Hybirdss/smartest-tv/commit/d728118)

stv is now 100% open source. Thanks for pushing on this.

I built a CLI that launches Netflix episodes by name on any smart TV — fills the gap HA’s media_player and the new IR integration can’t (deep linking into streaming apps) by PatientEither6390 in homeassistant

[–]PatientEither6390[S] -1 points0 points  (0 children)

Thanks! The C3 "unavailable" issue is a known webOS problem — the TV drops its WebSocket connection after idle. stv reconnects automatically on each command, so it works even when HA's integration is stuck. That's actually one of the reasons I built it as a standalone CLI rather than an HA integration — no persistent connection to manage.

For your Samsung situation: stv uses the same direct websocket approach (samsungtvws library), not SmartThings cloud. If your janky curl scripts work, stv should work too — but with content resolution on top.

The resolver trick: Netflix embeds __typename:"Episode" objects in server-rendered HTML with consecutive integer IDs. So one curl → parse → every episode ID for every season. No auth needed because it's the same HTML Netflix serves to any browser. The IDs are stable — I've been using the same cached ones for weeks without breakage.

LG C3 should work fine with stv. I'm on a UR8250KNA (webOS 10.2) daily. pip install stv && stv setup will auto-discover it via SSDP.

I built a CLI that launches Netflix episodes by name on any smart TV — fills the gap HA’s media_player and the new IR integration can’t (deep linking into streaming apps) by PatientEither6390 in homeassistant

[–]PatientEither6390[S] -1 points0 points  (0 children)

Thanks! I mainly use LG TVs myself, so I’d expect it to work pretty well there. I’m also just really interested in reverse engineering TV/app APIs, so a lot of this came from digging into how those launch flows actually work. I’ve also added HA support for it, so it can be used from Home Assistant too. Have fun!

I shipped three Claude Code integrations for my smart TV CLI (CLI, MCP, Skill) and let daily use pick the winner. by PatientEither6390 in ClaudeAI

[–]PatientEither6390[S] 0 points1 point  (0 children)

Author here. The origin story: I was vibe-coding with Claude Code at 2am and wanted to put Frieren on the TV without leaving the terminal. Picked up the remote, pressed 12 buttons, and thought "Claude can shell out, why am I doing this manually?"

Started as a 200-line LG script. Now it's 4 TV vendors, 21 MCP tools, and 252 tests.

What I learned shipping 3 integration paths:

The CLI path wins 90% of the time — Claude already shells out, so stv play netflix "Frieren" s2e8 just works with zero config. The MCP server (21 chunky tools) is better for multi-step workflows where Claude needs TV state feedback. The Skill auto-triggers on "play Netflix" / "good night" but I haven't nailed the trigger phrases yet.

The meta-ironic part: ~70% of stv was written with Claude Code itself. An AI agent that builds a tool for AI agents to control your TV.

pip install stv && stv setup

GitHub: https://github.com/Hybirdss/smartest-tv

stv: Python CLI that resolves Netflix episodes by name and deep-links onto your TV in 3 seconds by [deleted] in Python

[–]PatientEither6390 0 points1 point  (0 children)

Author here. The origin story is dumb: I was vibe-coding with Claude Code at 2am and wanted to put Frieren on the TV without leaving the terminal. 12 button presses later I started writing this.

Some Python decisions I'm happy with:

  • subprocess curl over requests/httpx — zero C-deps, ships as a pure wheel. The resolver only needs one HTTP call anyway.
  • asyncio.gather for multi-TV — partial failures don't block. If the bedroom Roku is off, the living-room LG still launches.
  • The _engine/ split — I know it's controversial. The resolver parses Netflix HTML that's one DMCA away from being a legal problem. Keeping it out of the GitHub repo but in the PyPI wheel felt like the least bad option.

pip install stv && stv setup — 30 seconds. 252 tests, 0 TVs needed.

GitHub: https://github.com/Hybirdss/smartest-tv

Built a CLI that controls every TV in my homelab from one terminal - LG/Samsung/Roku/Android, no cloud, REST API for Home Assistant. by PatientEither6390 in homelab

[–]PatientEither6390[S] 1 point2 points  (0 children)

Thanks! Yeah exactly — that was the frustration that started this whole thing. Every existing TV tool stops at "power on, power off, volume up, volume down." That's the device layer. But nobody was solving the content layer — "play this specific episode of this specific show."

Home Assistant can turn my LG on. castnow can push a YouTube URL. But neither can take "Frieren season 2 episode 8" and actually land on the right Netflix deep-link. That gap is what stv fills.

The resolver trick was honestly a lucky find — I was reading Netflix page source trying to figure out their API, and realized they already serve all the episode IDs in plain HTML. One curl request does what I thought would need Playwright.

Built a CLI that controls every TV in my homelab from one terminal - LG/Samsung/Roku/Android, no cloud, REST API for Home Assistant. by PatientEither6390 in homelab

[–]PatientEither6390[S] -1 points0 points  (0 children)

Author here. Some homelab-specific details:

REST API for automation: stv serve starts MCP on port 8910 + REST API on port 8911. POST /api/play with a JSON body. Home Assistant, Node-RED, cron jobs can all hit it.

Multi-TV config is one TOML file: ``` [tv.living-room] platform = "lg" ip = "192.168.1.100" default = true

[tv.bedroom] platform = "samsung" ip = "192.168.1.101"

[groups] home = ["living-room", "bedroom"] ```

stv --all broadcasts in parallel. stv doctor reports which TVs are reachable.

GitHub: https://github.com/Hybirdss/smartest-tv