ohld / igbot

🐙 Free scripts, bots and Python API wrapper. Get free followers with our auto like, auto follow and other scripts!
https://hikerapi.com/p/N2P6iqiM
Apache License 2.0
4.71k stars 1.47k forks source link

Proxy not working #1084

Closed twoandahalf2 closed 4 years ago

twoandahalf2 commented 5 years ago

Please follow the guide below


Before submitting an issue, make sure you have:

Purpose of your issue?


The following sections requests more details for particular types of issues, you can remove any section (the contents between the triple ---) not applicable to your issue.


For a bug report, you must include the Python version used, code that will reproduce the error, and the error log/traceback.

Paste the output of python -V here:

Code:

# Example code that will produce the error reported
from instabot import Bot

bot = Bot()
bot.login(username="user", password="pass")
followers = bot.get_user_followers(bot.user_id)

Error/Debug Log:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ZeroDivisionError: integer division or modulo by zero

Describe your issue

Hello guys,

I am trying to use proxy to start my bots. After purchasing a proxy from a website.. highproxies.com, I configured it to authenticate from my external IP and assigned it in the ultimate.py script.

my account logs on successfully without any errors but i still logon from my personal IP and not the proxy.

I tried to specify the proxy both in Bot() and in bot.login. It does not work. Any ideas on how to troubleshoot would be great. There is also alway the chance that the proxy itself is not working

bot = Bot( comments_file=config.COMMENTS_FILE, blacklist_file=config.BLACKLIST_FILE, whitelist_file=config.WHITELIST_FILE, friends_file=config.FRIENDS_FILE, device="samsung_galaxy_s9_plus", proxy="IP:PORT" )

bot.login(username="", password="", is_threaded=True, proxy="IP:PORT")

Oyetomi commented 5 years ago

Yes proxy isn't working in latest version

twoandahalf2 commented 5 years ago

thanks Virging :) .. I managed to figure it out by forcing all of the traffic to go through a proxy. However, I am still getting caught by Instagram. I think that this bot has been compromised and blocked now... Maybe I am wrong but I read Instagram is really cracking down on automation. ...

clintdoriot commented 5 years ago

I suspect the issue is related to this line of code:

https://github.com/instagrambot/instabot/blob/a6847d624cad44f9bb3ab40963842289e2fc5c6f/instabot/api/api.py#L242

Early in the login function, a session object is created and then the proxy is applied to it.

However, at line 242 of the current code, the session object that contains the proxy is replaced with a new session object, and the proxy is never reapplied

madshansens commented 5 years ago

can confirm i had to fix it myself. But my fix is "broken" is not worth an upload. I force parse proxy direct in package api/api.py.

davidhearnsmith commented 5 years ago

self.session = requests.Session()

I just # out this line and seems to work fine.

twoandahalf2 commented 5 years ago

self.session = requests.Session()

I just # out this line and seems to work fine.

David are you having any issues with the program in general? Do you get temp blocks from Instagram? I am having some serious problems.

madshansens commented 5 years ago

your question are not related to this issue.

If you got blocks you have to figure it out yourself, this service provide an api with examples. This service is for developers if you are having issue i suggest you reading the python documentation.

bruvv commented 4 years ago

I do not have a proxy nor used one (have a VPN) is this still an issue?

faizanumer commented 4 years ago

proxy="IP:PORT" where do i put the proxies's username and password sorry am a noob :)