From fb192fb050da95bb06c0987f15bb28db6e6cd206 Mon Sep 17 00:00:00 2001 From: aneuhmanh Date: Mon, 30 Jun 2025 14:07:35 +0000 Subject: [PATCH] init --- README.md | 14 ++++++++++++++ start-record.js | 18 ++++++++++++++++++ stop-record.js | 18 ++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 README.md create mode 100644 start-record.js create mode 100644 stop-record.js diff --git a/README.md b/README.md new file mode 100644 index 0000000..14ad95c --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +шаги: +1)скачать последнюю версию OBS ( НЕ с flatpak!!!) + +2)создать 2 файла js для начала и остановки записи + +3)посмотреть в obs websocket данные и заменить в js файлах + +4)установка npm + nodejs (sudo pacman -S install npm && sudo pacman -S nodejs) + +5)node -v && npm -v + +6)npm install obs-websocket-js (для установки зависимостей) + +7)настройка горячих клавиш в hyprland diff --git a/start-record.js b/start-record.js new file mode 100644 index 0000000..ff49e1b --- /dev/null +++ b/start-record.js @@ -0,0 +1,18 @@ +const OBSWebSocket = require('obs-websocket-js').default; +const obs = new OBSWebSocket(); + +async function startRecording() { + try { + await obs.connect('ws://АЙПИ:ПОРТ', 'ПАРОЛЬ'); + console.log('Connected to OBS'); + + await obs.call('StartRecord'); + console.log('Recording started'); + + await obs.disconnect(); + } catch (error) { + console.error('Error:', error); + } +} + +startRecording(); diff --git a/stop-record.js b/stop-record.js new file mode 100644 index 0000000..69d2319 --- /dev/null +++ b/stop-record.js @@ -0,0 +1,18 @@ +const OBSWebSocket = require('obs-websocket-js').default; +const obs = new OBSWebSocket(); + +async function stopRecording() { + try { + await obs.connect('ws://АЙПИ:ПОРТ', 'ПАРОЛЬ'); + console.log('Connected to OBS'); + + await obs.call('StopRecord'); + console.log('Recording stopped'); + + await obs.disconnect(); + } catch (error) { + console.error('Error:', error); + } +} + +stopRecording();