From 4a11f64cf53d7cc0a93ac2efdb7222336255d01d Mon Sep 17 00:00:00 2001
From: Tuuz <24893075+tobycroft@users.noreply.github.com>
Date: Mon, 18 Mar 2024 13:36:27 +0800
Subject: [PATCH 1/3] Update resources.md
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
修改get_record
新增get_file
---
docs/api/resources.md | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/docs/api/resources.md b/docs/api/resources.md
index 84cf7e6..032cf0b 100644
--- a/docs/api/resources.md
+++ b/docs/api/resources.md
@@ -99,6 +99,7 @@ icon: video-camera
| ---- | ------ | -------- |
| file | string | 文件路径 |
| url | string | 文件 URL |
+| md5 | string | 文件md5,get_file的时候用这个较稳定,然后你程序如果是反向ws,可以用这个作为record的等待ident |
## 检查是否可以发送语音
@@ -143,7 +144,26 @@ icon: video-camera
## 获取文件
-该接口用于获取文件。
+该接口用于获取语音,哦当然,这个接口目前使用的是base64返回,主要为了照顾使用反向websocket的用户,如果是正向用户或者getpost用户,直接用/res/去拿数据更方便
+
+### API 端点
+
+`/get_file`
+
+### 参数
+
+| 字段 | 类型 | 必须 | 说明 |
+| ---------- | ------ | ---- | -------- |
+| file | string | 是 | 文件 MD5 |
+| file_type | string | 是 | 输出格式 |
+
+### 响应
+
+| 字段 | 类型 | 说明 |
+| ---- | ------ | -------- |
+| file | string | 文件路径,和get_record一样 |
+| base64String | string | 文件 URL |
+| md5 | string | 文件md5 |
## 获取视频
From 6384694edd7f997dbade2fe95c72d5ff5bc897fe Mon Sep 17 00:00:00 2001
From: Tuuz <24893075+tobycroft@users.noreply.github.com>
Date: Mon, 18 Mar 2024 13:38:19 +0800
Subject: [PATCH 2/3] Update resources.md
---
docs/api/resources.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/api/resources.md b/docs/api/resources.md
index 032cf0b..e26857a 100644
--- a/docs/api/resources.md
+++ b/docs/api/resources.md
@@ -142,7 +142,7 @@ icon: video-camera
| ------ | -------- | ------------------------------------------------------------------------------------------------- |
| file | string | 转换后的语音文件路径, 如 `/home/somebody/cqhttp/data/record/0B38145AA44505000B38145AA4450500.mp3` |
-## 获取文件
+## 获取文件
该接口用于获取语音,哦当然,这个接口目前使用的是base64返回,主要为了照顾使用反向websocket的用户,如果是正向用户或者getpost用户,直接用/res/去拿数据更方便
From cb9176cca074d7b9d37ff793ccf465ab0c318b49 Mon Sep 17 00:00:00 2001
From: Tuuz <24893075+tobycroft@users.noreply.github.com>
Date: Mon, 18 Mar 2024 14:01:47 +0800
Subject: [PATCH 3/3] Update resources.md
---
docs/api/resources.md | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/docs/api/resources.md b/docs/api/resources.md
index e26857a..5c107b4 100644
--- a/docs/api/resources.md
+++ b/docs/api/resources.md
@@ -146,6 +146,9 @@ icon: video-camera
该接口用于获取语音,哦当然,这个接口目前使用的是base64返回,主要为了照顾使用反向websocket的用户,如果是正向用户或者getpost用户,直接用/res/去拿数据更方便
+如果你选择压缩,目前文本压缩性能较好,如果是音频或者视频,压缩率只有95.7%左右,大概只能节省5%的带宽,是否使用压缩获取可以自行考虑
+
+
### API 端点
`/get_file`
@@ -155,7 +158,7 @@ icon: video-camera
| 字段 | 类型 | 必须 | 说明 |
| ---------- | ------ | ---- | -------- |
| file | string | 是 | 文件 MD5 |
-| file_type | string | 是 | 输出格式 |
+| file_type | string | 是 | 输出格式,支持base64|gzip,如果获取大文件,可以选择压缩 |
### 响应