示例#1
0
    def run(self, *scouts):
        while True:
            self.scouts = list(scouts)
            if self.acc.username != "Waiting for account":
                self.active = True
                self.acc.run()
                self.active = False
            else:
                self.active = False
                self.acc.last_msg=""

            # if duplicate wait for master account to reconfigure this account to new login info
            if self.acc.duplicate == 1:
                log.info("semaphore waiting, index {}".format(self.index))
                while self.acc.duplicate == 1:
                    time.sleep(1)
                    pass
                log.info("exited semaphore, index {}".format(self.index))

            if self.acc.duplicate == 2:
                log.info("duplicate index {} changing accounts from {} to {}".format(self.index,self.acc.username,self.newacc['username']))
                self.acc.release(reason="removing multiplier account")
                self.acc = self.init_scout(self.newacc, 1)
                self.acc.duplicate = 1;
                
            if self.acc.duplicate == 0:
                if use_pgpool():
                    self.acc.release(reason=self.acc.last_msg)
                    self.swap_account(self.scouts)
                else:
                    # We don't have a replacement account since using CSV file, so just wait a very long time.
                    self.acc.release(reason=self.acc.last_msg)
                    time.sleep(60*60*24*1000)
                    break
示例#2
0
    def run(self):
        while True:
            self.active = True
            self.acc.run()
            self.active = False

            # Scout disabled, probably (shadow)banned.
            if use_pgpool():
                self.swap_account()
            else:
                # We don't have a replacement account, so just wait a veeeery long time.
                time.sleep(60 * 60 * 24 * 1000)
                break
示例#3
0
    def __init__(self, auth, username, password, job_queue):
        self.job_queue = job_queue
        self.active = True

        # Set up initial account
        initial_account = {
            'auth_service': auth,
            'username': username,
            'password': password
        }
        if not username and use_pgpool():
            initial_account = load_pgpool_accounts(1, reuse=True)
        self.acc = self.init_scout(initial_account)
示例#4
0
    def run(self):
        while True:
            self.active = True
            self.acc.run()
            self.active = False

            # Scout terminated, probably (shadow)banned.
            if use_pgpool():
                self.swap_account()
            else:
                # Just stop.
                self.active = False
                break
示例#5
0
 def __init__(self, auth, username, password, job_queue, duplicate, index):
     self.job_queue = job_queue
     self.active = False
     self.index = index
     self.newacc = {}
     self.scouts = []
     
     # Set up initial account
     initial_account = {
         'auth_service': auth,
         'username': username,
         'password': password
     }
     if not username and use_pgpool():
         initial_account = load_pgpool_accounts(1, reuse=True)
     self.acc = self.init_scout(initial_account, duplicate)
     self.active = True
示例#6
0
 def run(self):
     while True:
         if self.acc.username != "Waiting for account":
             self.active = True
             self.acc.run()
             self.active = False
             self.acc.release(reason=self.acc.last_msg)
         else:
             self.active = False
             self.acc.last_msg=""
             
         # Scout disabled, probably (shadow)banned.
         if use_pgpool():
             self.swap_account()
             time.sleep(5)
         else:
             # We don't have a replacement account, so just wait a veeeery long time.
             time.sleep(60*60*24*1000)
             break