Skip to content

Commit

Permalink
Fix issue with proxy_port arg
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuqlear committed Aug 22, 2018
1 parent d8fca75 commit 62931f3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions instapy/instapy.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def __init__(self,
headless_browser=False,
proxy_address=None,
proxy_chrome_extension=None,
proxy_port=0,
proxy_port=None,
bypass_suspicious_attempt=False,
multi_logs=False):

Expand Down Expand Up @@ -241,7 +241,7 @@ def set_selenium_local_session(self):
# this setting can improve pageload & save bandwidth
firefox_profile.set_preference('permissions.default.image', 2)

if self.proxy_address and self.proxy_port > 0:
if self.proxy_address and self.proxy_port:
firefox_profile.set_preference('network.proxy.type', 1)
firefox_profile.set_preference('network.proxy.http',
self.proxy_address)
Expand Down Expand Up @@ -274,7 +274,7 @@ def set_selenium_local_session(self):
.format(user_agent=user_agent))
capabilities = DesiredCapabilities.CHROME
# Proxy for chrome
if self.proxy_address and self.proxy_port > 0:
if self.proxy_address and self.proxy_port:
prox = Proxy()
proxy = ":".join([self.proxy_address, self.proxy_port])
prox.proxy_type = ProxyType.MANUAL
Expand Down

0 comments on commit 62931f3

Please sign in to comment.