ChatCopilot
is a tool implemented in golang
to obtain WeChat chat records and support real-time storage to the database. Currently it only supports running on MacOS
(because I don’t have a windows computer)
Add the following configuration file config/app.cfg
to the root directory of the executable file, and modify the corresponding mysql
and redis
configuration information in your machine
pod-id= 1
[mysql]
host= 127.0.0.1
port= 3306
user =root
password=secret
db=ChatCopilot
timezone=Asia/Shanghai
[redis]
host= 127.0.0.1
port= 6379
auth=secret
db= 0
[log]
dir=logs
max-age= 7
[wechat]
key=
path=./test
[task]
interval= 10
crontab=*/ 10 * * * * *
wechat.key
is the WeChat database key. See here for how to obtain it.
wechat.path
is the directory of mac
WeChat chat records. The specific situation depends on the actual storage location of your computer.
Example: /Users/james/Library/Containers/com.tencent.xinWeChat/Data/Library/Application Support/com.tencent.xinWeChat/2.0b4.0.9/5a22781f14219edfffa333cb38aa92cf/Message
Note: If there are spaces in the path,不需要
to add before the spaces.
task.interval
: The interval for executing synchronization tasks, in秒
(range 1-59), the default is 10
, and the priority is higher than task.crontab
task.crontab
: When task.interval
cannot meet your needs for task execution, you can use crontab
to set up scheduled tasks.
Execute the sql
statement in the migration
folder to create the corresponding database table
Select the corresponding system in Releases
to download the executable file, and execute it directly after decompression.
api
service ./chat-copilot api
Corresponding api
document address
./chat-copilot crontab
Synchronize new group chat records every 10 seconds
1. When receiving a larger original image or video, WeChat may not automatically download the original image. In this case, the file cannot be synchronized. Currently, synchronization can only be performed after manually clicking on the image to download. It has not been found yet. solution.
-L/usr/local/opt/openssl/lib
not found export CGO_CFLAGS= " -I/opt/homebrew/include "
export CGO_LDFLAGS= " -L/opt/homebrew/lib "
Enter WeChat -> Settings -> General -> Check the file settings to小于20MB 的文件自动下载
, and set the automatic download size file to 1024MB
(the maximum can only be set to 1024MB
, so if the file is not downloaded during synchronization Cannot sync files larger than 1024MB
)
Export years of WeChat chat history https://sspai.com/post/82577
PyWxDump https://github.com/xaoyaoo/PyWxDump
Use macOS WeChat to extract custom emoticons https://blog.jogle.top/2022/08/14/macos-wechat-sticker-dump/
silk-v3-decoder https://github.com/kn007/silk-v3-decoder
WeChatMsg https://github.com/LC044/WeChatMsg