Removed old code for proxy support in streaming API modules

This commit is contained in:
Manuel Cortez 2017-01-21 16:06:20 -06:00
parent db52e8d851
commit 6baf417d35
2 changed files with 2 additions and 16 deletions

View File

@ -10,14 +10,7 @@ log = original_logger.getLogger("TimelinesStream")
class timelinesStreamer(TwythonStreamer): class timelinesStreamer(TwythonStreamer):
def __init__(self, app_key, app_secret, oauth_token, oauth_token_secret, timeout=300, retry_count=None, retry_in=10, client_args=None, handlers=None, chunk_size=1, session=None): def __init__(self, app_key, app_secret, oauth_token, oauth_token_secret, timeout=300, retry_count=None, retry_in=10, client_args=None, handlers=None, chunk_size=1, session=None):
self.session = session self.session = session
args = None super(timelinesStreamer, self).__init__(app_key, app_secret, oauth_token, oauth_token_secret, timeout=60, retry_count=None, retry_in=180, handlers=None, chunk_size=1)
if config.app["proxy"]["server"] != "" and config.app["proxy"]["port"] != "":
args = {"proxies": {"http": "http://{0}:{1}".format(config.app["proxy"]["server"], config.app["proxy"]["port"]),
"https": "https://{0}:{1}".format(config.app["proxy"]["server"], config.app["proxy"]["port"])}}
if config.app["proxy"]["user"] != "" and config.app["proxy"]["password"] != "":
auth = HTTPProxyAuth(config.app["proxy"]["user"], config.app["proxy"]["password"])
args["auth"] = auth
super(timelinesStreamer, self).__init__(app_key, app_secret, oauth_token, oauth_token_secret, timeout=60, retry_count=None, retry_in=180, client_args=args, handlers=None, chunk_size=1)
self.lists = self.session.lists self.lists = self.session.lists
def on_error(self, status_code, data): def on_error(self, status_code, data):

View File

@ -9,14 +9,7 @@ log = original_logger.getLogger("MainStream")
class streamer(TwythonStreamer): class streamer(TwythonStreamer):
def __init__(self, app_key, app_secret, oauth_token, oauth_token_secret, sessionObject, *a, **kw): def __init__(self, app_key, app_secret, oauth_token, oauth_token_secret, sessionObject, *a, **kw):
args = None super(streamer, self).__init__(app_key, app_secret, oauth_token, oauth_token_secret, *a, **kw)
if config.app["proxy"]["server"] != "" and config.app["proxy"]["port"] != "":
args = {"proxies": {"http": "http://{0}:{1}".format(config.app["proxy"]["server"], config.app["proxy"]["port"]),
"https": "https://{0}:{1}".format(config.app["proxy"]["server"], config.app["proxy"]["port"])}}
if config.app["proxy"]["user"] != "" and config.app["proxy"]["password"] != "":
auth = HTTPProxyAuth(config.app["proxy"]["user"], config.app["proxy"]["password"])
args["auth"] = auth
super(streamer, self).__init__(app_key, app_secret, oauth_token, oauth_token_secret, client_args=args, *a, **kw)
self.session = sessionObject self.session = sessionObject
self.muted_users = self.session.db["muted_users"] self.muted_users = self.session.db["muted_users"]
# self.blocked_users = [] # self.blocked_users = []