Exemple #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'])
Exemple #2
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:
            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(user['username'])
            openBox_task()
            collectFlow_task()
        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'])
Exemple #3
0
 def main(self):
     i = 1
     for config in self.login:
         self.HT_cookies = config['cookies']
         self.HT_UserAgent = config['User-Agent']
         self.if_draw = config['if_draw']
         self.client = self.get_infouser()
         if self.client:
             try:
                 self.daySign_task()  # 执行每日签到
                 self.daily_viewgoods()  # 执行每日商品浏览任务
                 self.daily_sharegoods()  # 执行每日商品分享任务
                 self.daily_viewpush()  # 执行每日点推送任务
                 self.doTask_and_draw(
                 )  # 自己修改的接口,针对活动任务及抽奖,新增及删除活动请修改self.act_task
                 self.zaoshui_task()  # 早睡报名
             except Exception as e:
                 self.log += f'账号{i}执行出错:{e}\n'
                 print(f'账号{i}执行出错:{e}\n')
         else:
             self.log += f'账号{i}已失效,请及时更新cookies\n'
             print(f'账号{i}已失效,请及时更新cookies\n')
         i += 1
         self.log += '\n\n'
     if self.config['enterpriseWechat']['id']:
         notify.sendWechat(
             self.config['enterpriseWechat']['id'],
             self.config['enterpriseWechat']['secret'],
             self.config['enterpriseWechat']['agentld'], self.log,
             self.config['enterpriseWechat']['thumb_media_id'])
     if self.config['pushplusToken']:
         notify.sendPushplus(self.config['pushplusToken'], self.log)
Exemple #4
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'])
Exemple #5
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'])
Exemple #6
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'])
Exemple #7
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'])