新增deleteSnapDirectory删除截图接口

This commit is contained in:
xia-chu 2025-08-02 20:45:36 +08:00
parent 88ef00e429
commit b1e1a0f174
2 changed files with 58 additions and 2 deletions

View File

@ -310,6 +310,53 @@
},
"response": []
},
{
"name": "删除截图(deleteSnapDirectory)",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{ZLMediaKit_URL}}/index/api/deleteSnapDirectory?secret={{ZLMediaKit_secret}}&vhost={{defaultVhost}}&app=live&stream=test&file=71_1740828613.jpg",
"host": [
"{{ZLMediaKit_URL}}"
],
"path": [
"index",
"api",
"deleteSnapDirectory"
],
"query": [
{
"key": "secret",
"value": "{{ZLMediaKit_secret}}",
"description": "api操作密钥(配置文件配置)"
},
{
"key": "vhost",
"value": "{{defaultVhost}}",
"description": "筛选虚拟主机例如__defaultVhost__"
},
{
"key": "app",
"value": "live",
"description": "筛选应用名,例如 live"
},
{
"key": "stream",
"value": "test",
"description": "筛选流id例如 test"
},
{
"key": "file",
"value": "",
"disabled": true,
"description": "文件名,非必选"
}
]
}
},
"response": []
},
{
"name": "关断单个流(close_stream)",
"request": {
@ -522,7 +569,7 @@
"response": []
},
{
"name": "添加rtsp/rtmp/hls/srt拉流代理(addStreamProxy)",
"name": "添加拉流代理(addStreamProxy)",
"request": {
"method": "GET",
"header": [],
@ -560,7 +607,7 @@
{
"key": "url",
"value": "rtmp://live.hkstv.hk.lxdns.com/live/hks2",
"description": "拉流地址,例如rtmp://live.hkstv.hk.lxdns.com/live/hks2"
"description": "拉流地址,支持rtsp/rtmp/hls/srt/http-flv/http-ts协议"
},
{
"key": "rtp_type",

View File

@ -1927,6 +1927,15 @@ void installWebApi() {
File::deleteEmptyDir(record_path);
});
api_regist("/index/api/deleteSnapDirectory", [](API_ARGS_MAP) {
CHECK_SECRET();
CHECK_ARGS("vhost", "app", "stream");
GET_CONFIG(std::string, root, API::kSnapRoot);
auto path = File::absolutePath(allArgs["vhost"] + "/" + allArgs["app"] + "/" + allArgs["stream"] + "/" + allArgs["file"], root);
InfoL << "delete " << path;
File::delete_file(path, true);
});
// 获取录像文件夹列表或mp4文件列表 [AUTO-TRANSLATED:f7e299bc]
// Get the list of recording folders or mp4 files
//http://127.0.0.1/index/api/getMP4RecordFile?vhost=__defaultVhost__&app=live&stream=ss&period=2020-01