cli.debug("Like: [%s]:LOGGED -> %s:%i" %(email,video_id,status)) def subscribe_wrapper(email,password,channel_id): session = youtube_session(email, password) if session == -1: cli.debug("Sub: [%s:%s]:UNAUTH -> %s:0" %(email,password,channel_id) ) counters('action-f') return "authenticated" status = YT.subscribe(channel_id, session) counters('action-t') if status == 1 else counters('action-f') cli.debug("Sub: [%s]:LOGGED -> %s:%i" %(email,channel_id,status)) def on_exit(sig, frame): botgaurd.server_shutdown() cli.sys.exit(0) signal.signal(signal.SIGINT, on_exit) for identifier in cli.read_action_file(action_path): for credentials in cli.read_acounts_file(accounts_path): if action == "l": threader.put(like_wrapper,[credentials[0],credentials[1],identifier]) elif action == "s": threader.put(subscribe_wrapper,[credentials[0],credentials[1],identifier]) threader.finish_all() botgaurd.server_shutdown()
global action_faild session = Login(email, password) with lock: if session == -1: cli.debug("Sub: [%s:%s]:UNAUTH -> %s:0" % (email, password, channel_id)) action_faild += 1 else: status = YT.subscribe(channel_id, session) if status == 1: action_successful += 1 else: action_faild += 1 cli.debug("Sub: [%s:%s]:LOGGED -> %s:%i" % (email, password, channel_id, status)) def signal_handler(sig, frame): cli.debug_mode = 1 cli.show_status(login_successful, login_failed, action_successful, action_faild) signal.signal(signal.SIGINT, signal_handler) cli.menu_msg() for yt_id in cli.read_action_file(action_path): for credentials in cli.read_acounts_file(accounts_path): if action == "l": threader.put(Like, [credentials[0], credentials[1], yt_id]) elif action == "s": threader.put(Subscribe, [credentials[0], credentials[1], yt_id]) threader.finish_all()