Esempio n. 1
0
task_control = dict_user['task_control']
for i, user_info in enumerate(dict_user['users']):
    users.append(User(i, user_info, task_control, dict_bili))

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))
Esempio n. 2
0
fileDir = os.path.dirname(os.path.realpath('__file__'))

conf = ConfigLoader(fileDir)
area_ids = conf.dic_user['other_control']['area_ids']

# print('Hello world.')
printer.init_config()
bilibili()
online_net.login()
online_net.OnlineNet()
Statistics(len(area_ids))

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

list_raffle_connection = [connect.RaffleConnect(i) for i in area_ids]
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(),
Esempio n. 3
0
loop = asyncio.get_event_loop()
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(),
Esempio n. 4
0
printer = Printer()
bilibili()
login.login()
Statistics()

list_realroomid = None
# list_realroomid = ConfigLoader().dic_roomid['roomid']
list_realroomid = loop.run_until_complete(asyncio.gather(
    utils.getRecommend()))[0]
print(list_realroomid[:5])

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

list_raffle_connection = [
    connect.RaffleConnect(i - START + 1, list_realroomid[i])
    for i in range(START, END)
]
list_raffle_connection_task = [i.run() for i in list_raffle_connection]

yjchecking = connect.RaffleConnect(-1, None)

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

console_thread.start()


async def fetch_roomid_periodic():
    while True:
        now = datetime.now()
        print('当前时间为', now.minute, now.second)