def like_wrapper(email,password,video_id): session = youtube_session(email, password) if session == -1: cli.debug("Like: [%s:%s]:UNAUTH -> %s:0" %(email,password,video_id) ) counters('login-f') return "unauthenticated" status = YT.like(video_id, session) counters('action-t') if status == 1 else counters('action-f') cli.debug("Like: [%s]:LOGGED -> %s:%i" %(email,video_id,status))
def Like(email, password, video_id): global action_successful global action_faild session = Login(email, password) with lock: if session == -1: cli.debug("Like: [%s:%s]:UNAUTH -> %s:0" % (email, password, video_id)) action_faild += 1 else: status = YT.like(video_id, session) if status == 1: action_successful += 1 else: action_faild += 1 cli.debug("Like: [%s:%s]:LOGGED -> %s:%i" % (email, password, video_id, status))