def main(event, context): ip, country = check.getnetinfo() logging.info('【自检】: ' + str(ip) + '(' + str(country) + ')') logging.info('【自检】: 当前运行系统' + check.system()) if str(country) != '中国': logging.info('【自检】:您的地址异常,但本版本未做限制,通过! ') users = readJson() for user in users: #清空上一个用户的日志记录 open('./log.txt', mode='w', encoding='utf-8') global client client = login.login(user['username'], user['password'], user['appId']) username = user['username'] lotteryNum = user['lotteryNum'] if client != False: tasks.run(client, username, lotteryNum) if ('email' in user): notify.sendEmail(user['email']) if ('dingtalkWebhook' in user): notify.sendDing(user['dingtalkWebhook']) if ('telegramBot' in user): notify.sendTg(user['telegramBot']) if ('pushplusToken' in user): notify.sendPushplus(user['pushplusToken']) if ('enterpriseWechat' in user): notify.sendWechat(user['enterpriseWechat']) if ('IFTTT' in user): notify.sendIFTTT(user['IFTTT']) if ('Barkkey' in user): notify.sendBarkkey(user['Barkkey'])
def main(event, context): users = readJson() for user in users: #清空上一个用户的日志记录 open('./log.txt',mode='w',encoding='utf-8') global client client = login.login(user['username'],user['password'],user['appId']) if client != False: daySign_task(user['username']) dayOneG_Task() luckDraw_task() if ('lotteryNum' in user): pointsLottery_task(user['lotteryNum']) else: pointsLottery_task(0) day100Integral_task() dongaoPoints_task() woTree_task() gameCenterSign_Task() openBox_task() collectFlow_task() if ('email' in user) : notify.sendEmail(user['email']) if ('dingtalkWebhook' in user) : notify.sendDing(user['dingtalkWebhook']) if ('tgToken' in user) : notify.sendTg(user['tgToken'],user['tgUserId'])
def main(event, context): users = readJson() for user in users: #清空上一个用户的日志记录 open(os.getcwd()+os.sep+version+os.sep+'log.txt',mode='w',encoding='utf-8') global client client = login.login(user['username'],user['password'],user['appId']) if client != False: getIntegral() daySign_task(user['username']) dayOneG_Task() luckDraw_task() if ('lotteryNum' in user): pointsLottery_task(user['lotteryNum']) else: pointsLottery_task(0) day100Integral_task() dongaoPoints_task() gameCenterSign_Task(user['username']) openBox_task() collectFlow_task() woTree_task() actionFlow(user['username']) if ('email' in user) : notify.sendEmail(user['email']) if ('dingtalkWebhook' in user) : notify.sendDing(user['dingtalkWebhook']) if ('telegramBot' in user) : notify.sendTg(user['telegramBot']) if ('pushplusToken' in user): notify.sendPushplus(user['pushplusToken']) if('enterpriseWechat' in user): notify.sendWechat(user['enterpriseWechat'])
def main(event, context): ip, country = check.getnetinfo() logging.info('【地址自检】: ' + ip + '(' + country + ')') logging.info('【环境自检】: ' + check.system() + '(' + check.cpu() + ')') if not check.ippass(): logging.error('【地址异常】:您的地址异常,退出') sys.exit() if check.system() == 'Linux': if check.virtual(): logging.error('【环境异常】:环境异常,退出') sys.exit() #配置检测生成 if not os.path.isfile('config.json'): newconfig('./config.json') logging.error('【配置异常】:配置不存在已自动生成,请修改后使用') sys.exit() users = readJson() #黑名单处理逻辑 for user in users: for banuser in banlist: if banuser == user['username']: logging.error('登陆失败,请提issue反馈') sys.exit() #清空上一个用户的日志记录 open('./log.txt', mode='w', encoding='utf-8') global client client = login.login(user['username'], user['password'], user['appId']) username = user['username'] if ('lotteryNum' in user): lotteryNum = user['lotteryNum'] else: lotteryNum = 0 #任务调度代码 if client != False: scheduler.runscheduler(client, username, lotteryNum) else: logging.error('发生登陆错误,退出') sys.exit() scheduler.resetJson('./', './', 0) if ('email' in user): notify.sendEmail(user['email']) if ('dingtalkWebhook' in user): notify.sendDing(user['dingtalkWebhook']) if ('telegramBot' in user): notify.sendTg(user['telegramBot']) if ('pushplusToken' in user): notify.sendPushplus(user['pushplusToken']) if ('enterpriseWechat' in user): notify.sendWechat(user['enterpriseWechat']) if ('IFTTT' in user): notify.sendIFTTT(user['IFTTT']) if ('Bark' in user): notify.sendBark(user['Bark'])
def main(event, context): ip,country=check.getnetinfo() logging.info('【网络自检】: ' + str(ip) +'('+ str(country) +')') logging.info('【环境自检】: ' + check.system()+'('+check.cpu()+')') if check.system() == 'Linux': virtual_mode = str(check.virtual()) logging.info('【环境自检】: 虚拟化类型:' + virtual_mode) if virtual_mode != 'none': logging.info('【环境自检】:您的系统异常,但本版本未做限制,通过! ') if str(country)!='China': logging.info('【网络自检】:您的网络异常,但本版本未做限制,通过! ') users = readJson() for user in users: #清空上一个用户的日志记录 open('./log.txt',mode='w',encoding='utf-8') global client client = login.login(user['username'],user['password'],user['appId']) username = user['username'] if ('lotteryNum' in user): lotteryNum = user['lotteryNum'] else: lotteryNum = 0 #任务调度代码 if client != False: scheduler.runscheduler(client,username,lotteryNum) else: logging.error('发生登陆错误,退出') sys.exit() scheduler.resetJson('./','./',0) if ('email' in user) : notify.sendEmail(user['email']) if ('dingtalkWebhook' in user) : notify.sendDing(user['dingtalkWebhook']) if ('telegramBot' in user) : notify.sendTg(user['telegramBot']) if ('pushplusToken' in user): notify.sendPushplus(user['pushplusToken']) if('enterpriseWechat' in user): notify.sendWechat(user['enterpriseWechat']) if('IFTTT' in user): notify.sendIFTTT(user['IFTTT']) if('Barkkey' in user): notify.sendBarkkey(user['Barkkey'])
def main(event, context): users = readJson() for user in users: #清空上一个用户的日志记录 open('./log.txt', mode='w', encoding='utf-8') global client client = login.login(user['username'], user['password'], user['appId']) if client != False: getIntegral() daySign_task(user['username']) luckDraw_task() if ('lotteryNum' in user): pointsLottery_task(user['lotteryNum']) else: pointsLottery_task(0) day100Integral_task() dongaoPoints_task() gameCenterSign_Task(user['username']) woTree_task() #actionFlow(user['username']) monthOneG(user['username']) if ('autoKingCardType' in user): autoKingCardWelfare(user['autoKingCardType']) if ('email' in user): notify.sendEmail(user['email']) if ('dingtalkWebhook' in user): notify.sendDing(user['dingtalkWebhook']) if ('telegramBot' in user): notify.sendTg(user['telegramBot']) if ('pushplusToken' in user): notify.sendPushplus(user['pushplusToken']) if ('enterpriseWechat' in user): notify.sendWechat(user['enterpriseWechat']) if ('IFTTT' in user): notify.sendIFTTT(user['IFTTT']) if ('Bark' in user): notify.sendBark(user['Bark'])
#当前为连续签到的第几天 day = int(res2['resdata']['signDays']) #签到得到的积分 point = trance[day % 7] + 300 if day == 1 else trance[day % 7] logging.info('【东奥积分活动】: ' + res1['resdata']['desc'] + ',' + str(point) + '积分') else: logging.info('【东奥积分活动】: ' + res1['resdata']['desc'] + ',' + res2['resdata']['desc']) time.sleep(1) except Exception as e: print(traceback.format_exc()) logging.error('【东奥积分活动】: 错误,原因为: ' + str(e)) if __name__ == '__main__': if client != False: daySign_task() luckDraw_task() pointsLottery_task() day100Integral_task() dongaoPoints_task() woTree_task() gameCenterSign_Task() openBox_task() collectFlow_task() if len(os.environ.get('EMAIL_COVER')) != 0: notify.sendEmail() if len(os.environ.get('DINGTALK_WEBHOOK')) != 0: notify.sendDing()