Пример #1
0
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'])
Пример #2
0
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'])
Пример #3
0
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'])
Пример #4
0
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()
            if check():
                gameCenterSign_Task(user['username'])
                openBox_task()
            collectFlow_task()
            woTree_task()
            actionFlow(user['username'])
        if ('email' in user):
            notify.sendEmail(user['sendEmail'], user['receiveEmail'],
                             user['smtpPassword'], user['smtpServer'])
        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'])
Пример #5
0
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'])