Cliptalk
使用谷歌 gemini-pro-vision和gemini-pro或者 GPT4-vision以及 GPT4来解析抖音和tiktok以及本地视频内容,分析成文本内容,另外附带抖音和 tiktok去水印接口
Install / Use
/learn @disingn/CliptalkREADME
ClipTalk
ClipTalk is a tool designed for removing watermarks from TikTok videos and converting video content into text. It is now compatible with TikTok.
Demo: https://gpts.nbai.chat
Table of Contents
Installation <a name="installation"></a>
Clone the Repository
git clone https://github.com/disingn/cliptalk.git
Build the Application
Note: I assume that you have already installed ffmpeg and the go environment locally or on your server. If these are not installed, please install them first!!! Otherwise, it won't run.
cd cliptalk
export GOOS=linux
export GOARCH=amd64
go build -o cliptalk
Configuration File
Copy the example configuration file and modify it:
cp config.yaml.example config.yaml
Edit the config.yaml file and fill in the necessary configuration information:
App:
# Gemini's apikey
GeminiKey:
- key1
- key2
# Custom Gemini URL, you can use https://zhile.io/2023/12/24/gemini-pro-proxy.html#more-587 as a proxy
# PS: Do not include a trailing slash in the proxy address
# If you configure a GeminiUrl, you do not need to configure a Proxy
GeminiUrl: https://gemini.baipiao.io
# Browser UserAgent for parsing TikTok links
UserAgents:
- Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Safari/605.2.15
- Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.104 Safari/537.66
# Note: Do not include a trailing slash in the OpenaiUrl. You can also change it to your own reverse proxy address or a compatible OpenAI address
OpenaiUrl: https://api.openai.com
OpenaiKey:
- key1
- key2
# Server Configuration
Sever:
Port: 3100
Host: localhost
# Maximum file size for uploads in MB, default is 10MB, do not write 0
MaxFileSize: 10
# # Proxy Configuration, use a proxy (http|https|socks5://ip:port)
# Proxy:
# Protocol: socks5://192.168.1.10:3200
# Proxy Configuration, no proxy
Proxy:
Protocol:
If you find the configuration process cumbersome, you can directly use the example configuration file.
Start the Application
./cliptalk
Configure Nginx Reverse Proxy
Please refer to the official Nginx documentation for configuration or use tools like Baota or 1panel.
Usage <a name="usage"></a>
API Endpoints
TikTok Watermark Removal API
Method: POST
Endpoint: /remove
Example:
curl --location --request POST 'localhost:3100/remove' \
--header 'Content-Type: application/json' \
--data-raw '{
"url":"https://v.douyin.com/iLYNG8vA/"
}'
Returned JSON parameters:
{
"finalUrl": "Watermark-free video link",
"message": "success",
"title": "Video title"
}
TikTok Video to Text API
Method: POST
Endpoint: /video
Example:
curl --location --request POST 'localhost:3100/video' \
--header 'Content-Type: application/json' \
--data-raw '{
"url":"https://v.douyin.com/iLYnjXbA/",
"model":"openai" // The 'model' here can be 'openai' or 'gemini'
}'
Returned JSON parameters:
{
"finalUrl": "Watermark-free video link",
"message": "success",
"title": "Video title",
"content": "Video text"
}
Local Video to Text API
Method: POST
Endpoint: /video-file
Example:
curl --location --request POST 'localhost:3100/video-file' \
--form 'file=@"/test.mp4"' \
--form 'model="openai"'
Returned JSON parameters:
{
"content": "Video text"
}
Public Testing Interfaces:
Please note that the key must correspond to the selected model's API key, otherwise an error will occur. For the openai model, the default interface is the official OpenAI API: https://api.openai.com, so please use the official API key for the openai model.
TikTok Video Watermark Removal Interface
Request Method: POST
Request URL: /remove
Example:
curl --location --request POST 'https://gpts.nbai.chat/remove' \
--header 'Content-Type: application/json' \
--data-raw '{
"url":"https://v.douyin.com/iLYNG8vA/"
}'
Returned JSON Parameters:
{
"finalUrl": "Link to the video without watermark",
"message": "success",
"title": "Video title"
}
TikTok Video to Text Interface
Request Method: POST
Request URL: /video
Example:
curl --location --request POST 'https://gpts.nbai.chat/video' \
--header 'Authorization: key1,key2' \
--header 'Content-Type: application/json' \
--data-raw '{
"url":"https://v.douyin.com/iLYnjXbA/",
"model":"gemini"
}'
Returned JSON Parameters:
{
"finalUrl": "Link to the video without watermark",
"message": "success",
"title": "Video title",
"content": "Text from the video",
"duration": "Video duration In seconds"
}
Local Video to Text Interface
Request Method: POST
Request URL: /video-file
Example:
curl --location --request POST 'https://gpts.nbai.chat/video-file' \
--header 'Authorization: key1,key2' \
--form 'file=@"/path/to/test.mp4"' \
--form 'model="openai"'
Returned JSON Parameters:
{
"content": "Text from the video"
}
Docker Deployment <a name="docker-deployment"></a>
Prerequisites
Make sure Docker and Docker Compose are installed.
Deployment
cd cliptalk
docker-compose up -d
or
./update.sh
Local Development <a name="local-development"></a>
Some experience with writing Go code is required
Required Environment (assuming you already have it)
- Install Go
- Install ffmpeg
Development
cd cliptalk
go mod tidy
go run main.go
The code directory is also written in a simple and clear manner, no further explanation is needed.
Miscellaneous <a name="miscellaneous"></a>
For further assistance or if you have any questions, feel free to join our Telegram group.
Contact Us <a name="contact-us"></a>
If you have any questions or need support, please contact us through the following means:
