Spy是什么?
在很多频道会经常看到一些活动链接和一些莫名的参数,很多人不清楚怎么用,或者不想自己手动拼接,Spy就是解放你的双手,让机器人自动添加脚本需要的环境变量并运行。
注意事项
本教程基于Faker一键安装2.11.3版本青龙,Faker2,3库使用。其他版本自测。
云服务器为CentOS7.6系统。
云服务器必须可以科学上网,否则无法使用spy。科学上网教程晚点出。
下载安装Spy
打开Finalshell,连接云服务器。首先安装Docker Docker安装方法不再赘述。
1、输入以下命令 每次输入命令前请等待命令执行完成。
wget -O autospy https://raw.githubusercontent.com/xieshang/AutoSpy/master/docker.sh && chmod +x autospy && ./autospy docker exec -it auto_spy bash bash <(curl -s -L https://raw.githubusercontent.com/xieshang/AutoSpy/master/spy_update.sh) mv auto_spy_bot.py auto_spy_bot2.py exit docker restart auto_spy docker exec -it auto_spy bash pip uninstall telethon 此处会询问,填写Y,回车。 pip install telethon==1.24.0
获取Spy授权
首先进入Spy授权群 https://t.me/spy_auth 输入/spy 试用。获取授权码,请先私聊一遍SPY授权管家机器人。
创建青龙应用
如图在青龙面板创建一个应用,权限全给即可。保存好Client ID和Secret。
获取Telegram API以及参数
打开https://my.telegram.org/auth 登录TG 登录时请输入手机号格式为+86186xxxxxxxx
验证码会发送到TG。
保存好App api_id和App api_hash。
打开telegram客户端,创建一个公开群组。群组为发送监控日志使用。
用人形或其他方法获取自己的ID和群组ID
我用的是人形。
群组ID为-开头的。
个人TGID是正数。
修改配置文件
配置文件在/root/auto_spy_data/autospy文件夹内的auto_spy.yaml。
下面Faker整理了Faker仓库内变量脚本所需要的所有设置。
手动填写需要填写的即可。
此处复制机器人发给你的内容 Aauthentication:xxxxx AutoRestart: '' Container_Wait: 3 LogEnable: true QingLong: - Client_ID: 青龙应用ID Client_Secret: 青龙应用秘钥 url: http://青龙ip:5700 Telegram: Log_En: true TgLost: '' Welcome: Faker,我来啦~~ api_hash: 上方的TG API HASH api_id: 上方的TG API ID forward_channel_id: '' forward_keyword: [] forward_user_id: [] forward_user_name: [] listen_CH: - -1001765547510 - -1001415461569 - -1001276799295 - -1001591969398 - -1001728533280 - -1001765547510 - -1001718319262 - -1001533334185 - -1001720740578 log_id: -你自己创建的TG监控群号 master_id: - 你的TGID mtproto: '' proxy_http: '' proxy_ip: '' proxy_password: '' proxy_port: proxy_type: '' proxy_username: '' Use_SillyGirl: false WaitTime: 10 branch: master down_proxy: '' js_config: - Container: - - 1 Env: jd_wxCartKoi_activityId KeyWord: - - jd_wxCartKoi_activityId Name: 【云上】购物车锦鲤 Script: jd_wxCartKoi.js TimeOut: 0 Wait: 5 - Container: - - 1 Env: WXGAME_ACT_ID KeyWord: - - WXGAME_ACT_ID Name: 【云上】通用游戏任务 Script: jd_wxgame.js TimeOut: 0 Wait: 2 - Container: - - 1 Env: jd_wxFansInterActionActivity_activityId KeyWord: - - jd_wxFansInterActionActivity_activityId Name: 【云上】粉丝互动 Script: jd_wxFansInterActionActivity.js TimeOut: 0 Wait: 10 - Container: - - 1 Env: jd_wxSecond_activityId KeyWord: - - jd_wxSecond_activityId Name: 【云上】读秒拼手速 Script: jd_wxSecond.js TimeOut: 0 Wait: 2 - Container: - - 1 Env: computer_activityId KeyWord: - - computer_activityId Name: 【云上】电脑配件 OverdueTime: 600 Script: jd_computer.js TimeOut: 0 Wait: 5 - Container: - - 1 Env: jd_fxyl_activityId KeyWord: - - jd_fxyl_activityId Name: 【云上】分享有礼 Script: jd_share.js TimeOut: 0 Wait: 2 - Container: - - 1 Env: jd_cjhy_wxKnowledgeActivity_activityId KeyWord: - - jd_cjwxKnowledgeActivity_activityId - - jd_cjhy_wxKnowledgeActivity_activityId Name: 【云上】CJ知识超人 Script: jd_cjhy_wxKnowledgeActivity.js TimeOut: 0 Wait: 2 - Container: - - 1 Env: jd_lzkj_wxKnowledgeActivity_activityId KeyWord: - - jd_lzkj_wxKnowledgeActivity_activityId - - jd_wxKnowledgeActivity_activityId Name: 【云上】LJ知识超人 Script: jd_lzkj_wxKnowledgeActivity.js TimeOut: 0 Wait: 2 - Container: - - 1 Env: jd_cjhy_activityId KeyWord: - - jd_cjhy_activityId Name: 【组队】CJ瓜分京豆 Script: jd_cjzdgf.js TimeOut: 0 Wait: 5 - Container: - - 1 Env: jd_zdjr_activityId KeyWord: - - jd_zdjr_activityId Name: 【组队】ZJ瓜分京豆 Script: jd_zdjr.js TimeOut: 0 Wait: 5 - Container: - - 1 Env: PKC_TXGZYL KeyWord: - - PKC_TXGZYL Name: 【PKC】关注有礼-特效 Script: jd_txgzyl.js TimeOut: 0 Wait: 2 - Container: - - 1 Env: PKC_GZYL KeyWord: - - PKC_GZYL Name: 【PKC】关注有礼 Script: pkc_gzyl.js TimeOut: 0 Wait: 2 - Container: - - 1 Env: jd_cjhy_wxCollectionActivityId KeyWord: - - jd_cjhy_wxCollectionActivityId Name: 【抽奖】cjhy加购物车 Script: jd_cjhy_wxCollectionActivity.js TimeOut: 0 Wait: 2 - Container: - - 1 Env: jd_cjhy_wxDrawActivity_Id KeyWord: - - jd_cjhy_wxDrawActivity_Id Name: 【抽奖】cjhy幸运抽大奖 Script: jd_cjhy_wxCollectionActivity.js TimeOut: 0 Wait: 2 - Container: - - 1 Env: jd_lzkj_wxCollectionActivityId KeyWord: - - jd_lzkj_wxCollectionActivityId Name: 【抽奖】lzkj加购物车 Script: jd_lzkj_wxCollectionActivity.js TimeOut: 0 Wait: 2 - Container: - - 1 Env: jd_wxCollectCard_activityId KeyWord: - - jd_wxCollectCard_activityId Name: 【抽奖】集卡抽奖通用 Script: jd_wxCollectCard.js TimeOut: 0 Wait: 2 - Container: - - 1 Env: JD_Lottery KeyWord: - - JD_Lottery Name: 【抽奖】joy抽奖机通用 Script: jd_lotterys.js TimeOut: 0 Wait: 2 - Container: - - 1 Env: jd_wxShopFollowActivity_activityId KeyWord: - - jd_wxShopFollowActivity_activityId Name: 【抽奖】关注店铺抽奖 Script: jd_wxShopFollowActivity.js TimeOut: 0 Wait: 2 - Container: - - 1 Env: jd_mhurlLis KeyWord: - - jd_mhurlLis Name: 【抽奖】盲盒抽京豆 Script: jd_mhtask.js TimeOut: 0 Wait: 2 - Container: - - 1 Env: jd_nzmhurl KeyWord: - - jd_nzmhurl Name: 【抽奖】女装盲盒抽京豆 Script: jd_nzmh.js TimeOut: 0 Wait: 2 - Container: - - 1 Env: DPLHTY KeyWord: - - DPLHTY Name: 【开卡】大牌联合 Script: jd_opencardLH.js TimeOut: 0 Wait: 2 - Container: - - 1 Env: VENDER_ID KeyWord: - - VENDER_ID Name: 【开卡】入会开卡领取礼包 Script: jd_card_force.js TimeOut: 0 Wait: 2 - Container: - - 1 Env: jd_wdz_activityId KeyWord: - - jd_wdz_activityId Name: 【开卡】微定制 Script: jd_wdz.js TimeOut: 0 Wait: 10 - Container: - - 1 Env: yhyauthorCode KeyWord: - - yhyauthorCode Name: 【开卡】邀请赢大礼 Script: jd_yqhy.py TimeOut: 0 Wait: 5 - Container: - - 1 Env: JD_JOYOPEN KeyWord: - - JD_JOYOPEN Name: 【开卡】JoyJd任务脚本 Script: jd_opencard_joyopen.js TimeOut: 0 Wait: 2 - Container: - - 1 Env: jd_wdz_openLuckBag_activityId KeyWord: - - jd_wdz_openLuckBag_activityId Name: 【开卡】微定制-开福袋 Script: jd_wdz_openLuckBag.js TimeOut: 0 Wait: 5 - Container: - - 1 Env: DPQDTK KeyWord: - - DPQDTK Name: 【签到】店铺签到 Script: jd_dpqd.js TimeOut: 0 Wait: 2 - Container: - - 1 Disable: 0 Env: M_WX_LUCK_DRAW_URL KeyWord: - - M_WX_LUCK_DRAW_URL Name: 【M系】幸运抽奖 OverdueTime: 1800 Script: m_jd_wx_luckDraw.js TimeOut: 0 Wait: 2 - Container: - - 1 Disable: 0 Env: M_WX_ADD_CART_URL KeyWord: - - M_WX_ADD_CART_URL Name: 【M系】加购有礼 OverdueTime: 1800 Script: m_jd_wx_addCart.js TimeOut: 0 Wait: 2 - Container: - - 1 Disable: 0 Env: M_WX_COLLECT_CARD_URL KeyWord: - - M_WX_COLLECT_CARD_URL Name: 【M系】集卡抽奖 OverdueTime: 1800 Script: m_jd_wx_collectCard.js TimeOut: 0 Wait: 2 - Container: - - 1 Disable: 0 Env: M_WX_CENTER_DRAW_URL KeyWord: - - M_WX_CENTER_DRAW_URL Name: 【M系】老虎机抽奖 OverdueTime: 1800 Script: m_jd_wx_centerDraw.js TimeOut: 0 Wait: 2 - Container: - - 1 Disable: 0 Env: M_FAV_SHOP_ARGV KeyWord: - - M_FAV_SHOP_ARGV Name: 【M系】收藏有礼 OverdueTime: 1800 Script: m_jd_fav_shop_gift.js TimeOut: 0 Wait: 2 - Container: - - 1 Disable: 0 Env: M_FOLLOW_SHOP_ARGV KeyWord: - - M_FOLLOW_SHOP_ARGV Name: 【M系】关注有礼 OverdueTime: 1800 Script: m_jd_follow_shop.js TimeOut: 0 Wait: 2 - Container: - - 1 Env: M_WX_SHOP_GIFT_URL KeyWord: - - M_WX_SHOP_GIFT_URL Name: 【M系】关注有礼无线 OverdueTime: 1800 Script: m_jd_wx_shopGift.js TimeOut: 0 Wait: 2 - Container: - - 1 Env: M_WX_FOLLOW_DRAW_URL KeyWord: - - M_WX_FOLLOW_DRAW_URL Name: 【M系】关注抽奖 OverdueTime: 1800 Script: m_jd_wx_followDraw.js TimeOut: 0 Wait: 2 - Container: - - 1 Env: M_WX_BUILD_DRAW_URL KeyWord: - - M_WX_BUILD_DRAW_URL Name: 【M系】盖楼领奖 OverdueTime: 1800 Script: m_jd_wx_buildDraw.js TimeOut: 0 Wait: 2 - Container: - - 1 Env: jinggengInviteJoin KeyWord: - - jinggengInviteJoin Name: 【船长】邀请入会有礼 Script: jd_jinggengInvite.py TimeOut: 0 Wait: 2 - Container: - - 1 Env: jd_inv_authorCode KeyWord: - - jd_inv_authorCode Name: 【船长】邀请赢大礼 Script: jd_inviteFriendsGift.py TimeOut: 0 Wait: 2 - Container: - - 1 Env: jd_wxShopGiftId KeyWord: - - jd_wxShopGiftId Name: 【船长】特效关注有礼 Script: jd_wxShopGift.py TimeOut: 0 Wait: 2 - Container: - - 1 Env: jd_joinCommonId KeyWord: - - jd_joinCommonId Name: 【船长】通用开卡 Script: jd_joinCommon_opencard.py TimeOut: 0 Wait: 2 - Container: - - 1 Env: jd_shopLeagueId KeyWord: - - jd_shopLeagueId Name: 【船长】开卡-shopLeague系列 Script: jd_shopLeague_opencard.py TimeOut: 0 Wait: 2 - Container: - - 1 Env: jd_shopCollectGiftId KeyWord: - - jd_shopCollectGiftId Name: 【船长】店铺会员礼包 Script: jd_shopCollectGift.py TimeOut: 0 Wait: 2 - Container: - - 1 Env: jd_wdz_activityId KeyWord: - - jd_wdz_activityId Name: 【船长】微定制组队 Script: jd_wdz.py TimeOut: 0 Wait: 2 - Container: - - 1 Env: jd_wxCompleteInfoId KeyWord: - - jd_wxCompleteInfoId Name: 【船长】完善信息有礼 Script: jd_wxCompleteInfo.py TimeOut: 0 Wait: 2 - Container: - - 1 Env: M_WX_WDZ_ID KeyWord: - - M_WX_WDZ_ID Name: 【M系列】微定制 Script: m_jd_wx_microDz.js TimeOut: 0 Wait: 2 - Container: - - 1 Env: M_WX_SECOND_DRAW_URL KeyWord: - - M_WX_SECOND_DRAW_URL Name: 【M系列】读秒拼手速 Script: m_jd_wx_secondDraw.js TimeOut: 0 Wait: 2 - Container: - - 1 Env: jd_wxBirthGiftsId KeyWord: - - jd_wxBirthGiftsId Name: 【船长】生日礼包 Script: jd_wxBirthGifts.py TimeOut: 0 Wait: 2 update_url: https://raw.githubusercontent.com/xieshang/AutoSpy/master/updatelist.json
登录spy
将配置文件修改完成后。输入以下代码
python3 auto_spy_bot2.py
此时会出现登录界面,输入+86的手机号进行登录,验证码会发送到TG客户端。
登录成功后,查看Finalshell日志,看看是否成功执行。
输入Ctrl+C终止。输入后台执行代码
python3 auto_spy_bot2.py &
TG发送spy,看看是否有响应。
Ctrl+C终止 换回自动执行
mv auto_spy_bot2.py auto_spy_bot.py exit docker restart auto_spy