def __init__(self, useProxy=True, autoRotate=True, maxRequestcount=120, logindata=None): # Initialize # Gonna set some vars for statistics, login and proxy management # But rotating logins and proxys doesnt work well in the momen so it is not really used self.useProxy = True self.overallRequestCount = 0 self.ready = False self.currentCredit = None self.logindata = logindata self.autoRotate = autoRotate self.maxRequestCount = maxRequestcount Instagram.__init__(self, 1.3) # second arg is standard sleep after each req self.parent = super( customInstagram, self ) # Link to superclass, dont want to write super ... all the time self.Auth() # login and proxy selection # Inject Hook self.oldReqGet = self._Instagram__req.get #_...___ receives hidden var from super class... req = session, we will path get function in order to count requests and add additonal limits time/maxcount self._Instagram__req.verify = True self._Instagram__req.get = self.hookedRequest self.requestCount = 0
def Auth(self): Instagram.__init__(self, 0.1) if self.useProxy: if not self.RotateProxy(): self.ready = False return #logindata means the user has provided specific credentials - it is for the private account if not self.logindata: if not self.tryLogin(): self.ready = False return self.ready = True else: self.with_credentials(self.logindata[0], self.logindata[1]) try: self.login() self.ready = True except: self.ready = False
def __init__(self): Instagram.__init__(self) self.databaseFunc = DatabaseFunctions()
def __init__(self): Instagram.__init__(self) self.dbName = None