Merge pull request #5 from qikongjian/add_http_sample

Add http sample
This commit is contained in:
sun-guannan
2025-07-19 17:40:47 +08:00
committed by GitHub
3 changed files with 35 additions and 0 deletions

View File

@@ -114,6 +114,7 @@ response = requests.post("http://localhost:9001/save_draft", json={
print(response.json())
```
也可以用 REST Client 的 ```rest_client_test.http``` 进行http测试只需要安装对应的IDE插件
### 复制草稿到剪映/capcut草稿路径
调用`save_draft`会在服务器当前目录下生成一个`dfd_`开头的文件夹,将他复制到剪映/CapCut草稿目录即可看到生成的草稿

View File

@@ -116,6 +116,7 @@ response = requests.post("http://localhost:9001/save_draft", json={
print(response.json())
```
You can also use the ```rest_client_test.http``` file of the REST Client for HTTP testing. Just need to install the corresponding IDE plugin
### Copying the Draft to CapCut Draft Path

33
rest_client_test.http Normal file
View File

@@ -0,0 +1,33 @@
###添加文本
POST http://localhost:9001/add_text
Content-Type: application/json
{
"text": "你好,世界!",
"start": 0,
"end": 3,
"font": "SourceHanSansCN_Regular",
"font_color": "#FF0000",
"font_size": 30.0
}
###添加视频
POST http://localhost:9001/add_video
Content-Type: application/json
{
"video_url": "https://cdn.qikongjian.com/1752788403_5rnfds.mp4",
"start": 0,
"end": 10,
"width": 1080,
"height": 1920
}
###保存草稿
POST http://localhost:9001/save_draft
Content-Type: application/json
{
"draft_id": "dfd_cat_1752912902_0cae2e04",
"draft_folder":"/Users/xxx/Movies/JianyingPro/User Data/Projects/com.lveditor.draft/"
}