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 Subscribe(email, password, channel_id): global action_successful 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))