Beispiel #1
0
fileDir = os.path.dirname(os.path.realpath('__file__'))

ConfigLoader(fileDir)

# print('Hello world.')
printer = Printer()
bilibili()
login.login()
Statistics()

rafflehandler = Rafflehandler()
var_console = bili_console.Biliconsole(loop)

list_raffle_connection = [connect.RaffleConnect(i) for i in range(1, 5)]
list_raffle_connection_task = [i.run() for i in list_raffle_connection]
yjconnection = connect.YjConnection()

danmu_connection = connect.connect()


bili_timer = BiliTimer(loop)

console_thread = threading.Thread(target=var_console.cmdloop)

console_thread.start()

Tasks.init()
tasks = [
    OnlineHeart.run(),
    Silver.run(),
    danmu_connection.run(),
Beispiel #2
0
notifier.set_values(loop)
notifier.set_users(users)
bili_statistics.init_area_num(len(area_ids))

loop.run_until_complete(notifier.exec_func(-2, LoginTask.handle_login_status))

# users[1].fall_in_jail()

console_thread = threading.Thread(target=Biliconsole(loop).cmdloop)
console_thread.start()

danmu_tasks = [connect.RaffleConnect(i).run() for i in area_ids]

yj_danmu_roomid = dict_user['other_control']['raffle_minitor_roomid']
danmu_tasks.append(connect.YjConnection(yj_danmu_roomid).run())

default_monitor_roomid = dict_user['other_control']['default_monitor_roomid']
connect.init_danmu_roomid(default_monitor_roomid)
danmu_tasks.append(connect.run_danmu())

notifier.exec_task(-2, HeartBeatTask, 0, delay_range=(0, 5))
notifier.exec_task(-2, RecvHeartGiftTask, 0, delay_range=(0, 5))
notifier.exec_task(-2, OpenSilverBoxTask, 0, delay_range=(0, 5))
notifier.exec_task(-2, RecvDailyBagTask, 0, delay_range=(0, 5))
notifier.exec_task(-2, SignTask, 0, delay_range=(0, 5))
notifier.exec_task(-2, WatchTvTask, 0, delay_range=(0, 5))
notifier.exec_task(-2, SignFansGroupsTask, 0, delay_range=(0, 5))
notifier.exec_task(-2, SendGiftTask, 0, delay_range=(0, 5))
notifier.exec_task(-2, ExchangeSilverCoinTask, 0, delay_range=(0, 5))
notifier.exec_task(-2, JudgeCaseTask, 0, delay_range=(0, 5))
Beispiel #3
0
    ]


async def login_all(users):
    for user in users:
        if not (await user.handle_login_status()):
            sys.exit(-1)


loop.run_until_complete(asyncio.wait([login_all(users)]))

danmu_connection = connect.connect(
    dict_user['other_control']['default_monitor_roomid'])
list_raffle_connection = [connect.RaffleConnect(i) for i in range(1, 5)]
list_raffle_connection_task = [i.run() for i in list_raffle_connection]
yjconnection = connect.YjConnection(
    dict_user['other_control']['raffle_minitor_roomid'])

var_super_user = SuperUser(users[0])
raffle = RaffleHandler(users, var_super_user, loop, True)
normal_task = Task(users, var_super_user, loop)
state_task = StateTask(users, var_super_user, loop)

var_console = bili_console.Biliconsole(users, var_super_user, loop)
console_thread = threading.Thread(target=var_console.cmdloop)
console_thread.start()
normal_task.init()

tasks = [
    raffle.join_raffle(),
    danmu_connection.run(),
    state_task.run_workstate(),