真正的假期到今天已经结束咯,收拾收拾明天回家过年。白天躺在家里折腾了一阵 AutoRemote,配合 EventGhost 可以通过手机实现一些对 PC 的远程操作,总结一下踩到的坑。
安装过程
下载 EventGhost
按照这个步骤 :AutoRemote EventGhost Plugin 安装 AutoRemote 插件。主要就是下载其提供的
__init__.py
文件并复制到?\EventGhost\plugins\AutoRemote
这个文件夹。接下来重启 EventGhost,选择工具栏里的
Configuration -> add Plugin
添加 AutoRemote 插件,位于Other
文件夹内。
到这里 EventGhost 相关的配置就结束了,接下来就是与 AutoRemote 进行配对。
Mission One
下面有请第一个出现的坑~ GFW
最开始按照官方的教程走,输入手机的验证 URL 应用就会卡死,因为 AutoRemote 使用的短链服务被墙掉了。
这里有几个办法,可以根据自己的情况选择下。
- 使用 AutoRemote 的 Chrome 插件,可以看官网给的视频。
- 自己获取短链对应的
key
。注意是key
部分而不是完整地址,填到Device Key
中。 修改
plugin/AutoRemote/__init__.py
文件,添加 http 代理。记得重启 EventGhost。This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characterspluginVersionPattern = re.compile("version = \"([^\"]+)\"") pythonSubstitutionPattern = re.compile('\{[^\}]+\}') fileNameFromDownloadPattern = re.compile("filename=\"([^\"]+)\"") urlPattern = re.compile(ur'(?i)\b((?:https?://|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:\'".,<>?\xab\xbb\u201c\u201d\u2018\u2019]))') proxies = {'http': 'http://127.0.0.1:1080','https': 'https://127.0.0.1:1080'} proxy = urllib2.ProxyHandler(proxies) opener = urllib2.build_opener(proxy) urllib2.install_opener(opener) def DownloadFile(fileUrl, folder): if not shortUrl == '': try: if not "http" in shortUrl: shortUrl = "https://" + shortUrl result = urllib.urlopen('https://www.googleapis.com/urlshortener/v1/url?key=AIzaSyCW9fcDGiUhrqG8HKfNQJ9GuA8bxAZvUIQ&shortUrl={0}'.format(shortUrl),proxies=proxies).read() resultObj = json.loads(result) url = resultObj["longUrl"] parsed = urlparse.urlparse(url) key = urlparse.parse_qs(parsed.query)['key'][0] print key return key
ok,墙的问题解决了。
Mission Two
第二个坑是家里台式机的和 wifi 并不在同一子网。手机 IP 在192.168.3.*
,台式IP是192.168.2.*
,AutoRemote 会判定你不在同一个局域网内,很尴尬。折腾一阵终于找到解决办法,将 EventGhost AutoRemote 插件的公网 IP 配置成 PC 的局域网 IP,重新进行一次注册操作。等新的配置同步到手机就可以正常使用了。
嗯,可以开始折腾 Tasker 啦!
那么 新年快乐