interact with your computer (such as RaspberryPi) via WeChat
This scripts based on ItChat
Modified from this demo
It should support most commands you use in terminal, for instance df -h
or uname -a
This page can give you some hints.
- remote download
- cast online video
- & more
(This will install and configure aria2
, youtube-dl
, diana
, if you have installed the aria2
package, please check How to install
section.)
/bin/bash -c "$(curl -sL https://git.io/vXy3m)"
You should get itchat first:
sudo apt-get install python-dev python-pillow
sudo pip install itchat
install subprocess32
:
sudo pip install subprocess32
I would suggest run this scripts in screen
:
sudo apt-get install screen
screen bash
wget https://raw.githubusercontent.com/yangxuan8282/wechat-remote/master/wechat_remote.py
run the scripts:
python wechat_remote.py
then scan the QR code to login
And you need more steps to use the function you want:
- download file (aria2)
on Debian/Raspbian:
sudo apt-get update&&sudo apt-get upgrade
sudo apt-get install aria2
install diana
:
cd ~
git clone https://github.com/baskerville/diana
cd diana
sudo cp dad diana /usr/bin
start:
dad start
download file:
diana add url
check downloading:
diana list
- download video (youtube-dl)
on Debian/Raspbian:
pip install youtube-dl
message sample:
youtube-dl url
- online video (mpv)
before install mpv you need insall FFmpeg or Libav
for FFmpeg, there is a guide in my blog
and mpv installation
message sample:
mpv www.bilibili.com/video/av4306452/
- more
maybe you can use GPIO to remote control lighting
- For security reasons, this scripts will only process the message from yourself.(You can comment this line to toggle it.)
- Some WeChat account can't send message to himself, you should use filehelper branch, and send commmands to filehelper
- User should avoid sending commmands like
aria2c
orapt-get
, use wrapper instead, because the docs for Popen.communicate [1] say explicitly: " Wait for process to terminate.", so new commands won't process until those commmands fininsed