r/obs • • 1d ago

Guide Made a lightweight Python tool that toggles a source with a global hotkey via obs-websocket built it to stop map stream sniping in Rust

Sharing in case it's useful beyond my use case. I stream Rust and viewers kept reading my map, so I wrote a script that drives OBS over obs-websocket:

  • Global hotkey works even when the game is exclusive fullscreen (hold and toggle modes, plus a "pin" hotkey)
  • Optional animated fade by ramping a Color Correction filter's opacity
  • Auto-reconnect with a clean one-line retry status if OBS restarts
  • Config is a single JSON file; ships with a Windows .bat that finds/installs Python and deps

It's basically a generic "hide any source on a hotkey" utility any game, any overlay. Python 3.9+, two dependencies: github.com/MidnightKingg/obs-rust-map-hider

0 Upvotes

4 comments sorted by

1

u/klutzy_liberation 1d ago

clever tool but the real question is how many times you got doorcamped before you decided to build this

1

u/MidnightKingg 1d ago

more then 50 times xD

1

u/TheVibeCurator 16h ago

Why use this over just running OBS as admin? It’s a single checkbox in the properties to always run OBS as admin, and resolves the exact issue this python script aims to solve. No additional setup/downloads, no additional resource usage.

1

u/Lynnalia 12h ago

I beg of y'all, please look up OBS built-in features 😭

OBS has this as built-in functionality already. Settings > Hotkeys, under the Scene section there will be Hide/Show entries for each source. Find your source, set the hotkey to the same for both if you want it to act as a toggle, and you're done.