添加调用ABGI接口的OBS (#2301)

* OBS录制

* Enhance README with usage instructions and notes

Updated the README to include detailed instructions and notes on using the OBS recording script with auto-bgi software.
This commit is contained in:
古又
2025-11-03 11:39:47 +08:00
committed by GitHub
parent 2ebc75de39
commit f3de902d21
4 changed files with 112 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
# OBS录制
## 介绍
#### 该脚本是搭配auto-bgi软件使用进行开启本地开启OBS录制和结束
#### 不了解的可以去BetterGI的QQ频道搜索【auto-bgi】
#### 也可以电脑点击【[ABGI](https://gitee.com/wangjian0327/auto-bgi/blob/ginVue/README.md)】,进行学习,了解
------
## <font color=red>注意</font>
#### 使用`OBS录制`脚本时,`ABGI`最低版本为【<font color=#FF69B4>3.1</font>】
------
## 使用方法
#### 在`调度器`中新建`配置组``配置组`添加`OBS录制`右键脚本名字找到【修改通用配置】将里面的【JS HTTP权限】下的`禁用`选择`启用`在【修改JS脚本自定义设置】选or填相关内容
------
####图文教程步骤一:
<img style="zoom:200%;" alt="image" src="https://github.com/user-attachments/assets/7e42b666-8ece-4b77-a2d6-b97135452ff0" />
####图文教程步骤二:
<img style="zoom:200%;" alt="image" src="https://github.com/user-attachments/assets/676f5219-db3f-4db1-8932-e7a6628616b8" />
####图文教程步骤三:
<img style="zoom:200%;" alt="image" src="https://github.com/user-attachments/assets/35090925-d5d5-49cb-a49d-91a435de40c0" />
####图文教程步骤四:
<img style="zoom:200%;" alt="image" src="https://github.com/user-attachments/assets/75629811-de15-42aa-83b7-8a0d0c452257" />
####图文教程步骤五
<img style="zoom:200%;" alt="image" src="https://github.com/user-attachments/assets/f0a1b6c3-a90a-4eaa-a77c-fbccf01d7272" />
####图文教程步骤六
<img style="zoom:200%;" alt="image" src="https://github.com/user-attachments/assets/61525b45-22e7-4686-83cf-ca19bb3c1212" />
------
## 版本
#### 0.0.1
有啥不懂的,八九十群,可以艾特【古又】

21
repo/js/OBS录制/main.js Normal file
View File

@@ -0,0 +1,21 @@
(async function () {
try {
// 判断你是否运行ABGI
await http.request('GET', `http://localhost:8082/api/index`, null, null);
if (settings.selectScript == "开启录制") {
await http.request('POST', `http://localhost:8082/api/abgiObs/StartRecording`, null, null);
} else if (settings.selectScript == "关闭录制") {
if (settings.rename == "") {
await http.request('POST', `http://localhost:8082/api/abgiObs/StopRecording`, null, null);
return;
};
const fileName = settings.rename;
await http.request('POST', `http://localhost:8082/api/abgiObs/StopRecording?videoName=${fileName}`, null, null);
};
return;
} catch (error) {
log.error("你的ABGI未运行")
};
})();

View File

@@ -0,0 +1,26 @@
{
"manifest_version": 1,
"name": "OBS录制",
"version": "0.0.1",
"tags": [
"abgi"
],
"description": "录制哪个脚本",
"saved_files": [
],
"authors": [
{
"name": "隔壁老王",
"links": "https://github.com/wjdsg0327"
},
{
"name": "古又",
"links": "https://github.com/guyou45"
}
],
"http_allowed_urls": [
"http://localhost:8082/api/*"
],
"settings_ui": "settings.json",
"main": "main.js"
}

View File

@@ -0,0 +1,18 @@
[
{
"name": "selectScript",
"type": "select",
"label": "开启or关闭录制",
"options": [
"开启录制",
"关闭录制"
],
"default": ""
},
{
"name": "rename",
"type": "input-text",
"label": "是否重命名录制视频名称,只需选择关闭录制时填写",
"default": ""
}
]