GithubHelp home page GithubHelp logo

wechat-remote's Introduction

中文

wechat-remote

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.

What can it do

  • remote download
  • cast online video
  • & more

Quick install (Debian/Raspbian)

(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)"

How to install

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:

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

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

Tips:

  • 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 or apt-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

wechat-remote's People

Contributors

yangxuan8282 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

wechat-remote's Issues

自动检测系统环境,以决定字符宽度

现在没有找到很好的办法自动检测系统环境

如果是本机上运行脚本可以用以下代码实现:

from sys import platform as _platform

if _platform == "linux" or _platform == "linux2":
   # linux
	_char_width = 2
elif _platform == "darwin":
   # MAC OS X
	_char_width = 2
elif _platform == "win32":
   # Windows
	_char_width = True

...
itchat.auto_login(enableCmdQR = _char_width, hotReload = True)

但如果是通过 SSH 运行则不适用 ( 比如 win 上 通过 putty 访问 Linux 主机 ),现在需要找到检查是在本机上运行还是远程的方法

似乎会持续发送命令?

尝试了一次sudo reboot
之后若干次只要启动wechat_remote.py就会立即重启

小米5S+MIUI8+微信6.5.10
树莓派3+rasbian

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.