Python Forum
Python Instagram bot user-following problem - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Python Instagram bot user-following problem (/thread-1167.html)



Python Instagram bot user-following problem - danotto - Dec-09-2016

Hi, I found a Github program on a forum and want to use it to follow people on Instagram. It may have a bug that it follows the same people repeatedly but I don't know Python so I don't know how to fix it. Some other people on the forum have the same problem. We'd appreciate it if someone helped. I can't post links yet so here is the file follow_protocol (maybe the bug can be fixed from there).

#!/usr/bin/env python
# -*- coding: utf-8 -*-
from user_info import get_user_info
from feed_scanner import feed_scanner
import random
import time

def follow_protocol(self):
    limit = random.randint(5,10)
    while self.follow_counter<limit:
        chooser = 0
        if len(self.user_info_list)>0:
            chooser = random.randint(0,len(self.user_info_list)-1)
            self.current_user=self.user_info_list[chooser][0]
            self.current_id=self.user_info_list[chooser][1]
            print('=============== \nCheck profile of '+self.current_user+'\n===============')
            get_user_info(self, self.current_user)
        else :
            print('xxxxxxx user info list is empty!!! xxxxxxxxx')
            feed_scanner(self)
        if self.is_selebgram!=True and self.is_fake_account!=True and self.is_active_user!=False :
            if self.is_following!=True :                
                print('Trying to follow : ' + self.current_user + ' with user ID :' + self.current_id)
                self.follow(self.current_id)
                print('delete ' + self.user_info_list[chooser][0]+' from user info list')
                del self.user_info_list[chooser]
        else :
            print('delete ' + self.user_info_list[chooser][0]+' from user info list')
            del self.user_info_list[chooser]
                
        time.sleep(random.randint(13,26))



RE: Python Instagram bot user-following problem - Blue Dog - Dec-11-2016

I am not sure what you are trying to do?