2017/09/28
Wesync
A simple python project that automatically synchronizes wechat files to Google Drive/Any Cloud Drive save PanBaidu
一個(gè)神奇的Python項(xiàng)目, 同步你的微信文件
原理
- 用itchat第三方微信API登陸
- 當(dāng)接收到圖片或文件時(shí), 調(diào)用下載并將文件儲(chǔ)存在內(nèi)存
- 推送到integromat 然后自動(dòng)推送至云端儲(chǔ)存
- 推送status_code與fileName至文件傳輸助手
- 400
- integromat 錯(cuò)誤, 建議查看History
- 200
- 請(qǐng)求成功
- 同時(shí)返回下載連接
- 400
配置
Integromat
自動(dòng)化配置
- https://www.integromat.com/ 注冊(cè)
- 新建Scenario
- Webhooks: Custom Webhook
- Add webhook
- Add Data Structure
- Add item
- data
- Name: data
- Type: text
- filename
- Name: filename
- Type: text
- data
- Add item
- Add Data Structure
- Copy webhook url
- Add webhook
- Google Drive
- Choose a folder
- File name: filename
- Data: toBinary(data; base64)
- Error Handler (right click this module)
- Webhook Response
- Status: 400
- Ignore
- Webhook Response
- Webhooks: Webhook Response
- Status: 200
- Body: Share Link
- Webhooks: Custom Webhook
Windows
git clone https://github.com/William-An/wesync
wesync/Scripts/activate
# 預(yù)先將webhook的URL在sync.py中賦值為integromat
python sync.py
# enableCmdQR一定要為True
更多信息詳見itchat文檔
Linux
TO BE Continue
注意事項(xiàng)
- 云端儲(chǔ)存并不一定要Google Drive, 可以使用其他的云端服務(wù)像Dropbox
- 上傳到Google Drive的文件是默認(rèn)開放查看權(quán)限的, 擁有鏈接的人就可以查看或下載, 請(qǐng)自行衡量