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.69k stars 1.47k forks source link

Ultimate Schedule: INFO - Bot Stopped (Case 1) #576

Closed chadholman closed 6 years ago

chadholman commented 6 years ago

Please help with these random bot errors. Appears it was trying to run schedule.every(1).days.at("6:40").do(follow_users_from_hastag_file)

2018-06-23 06:38:03,735 - INFO - Nothing to like. 2018-06-23 06:40:01,448 - ERROR - Request returns 404 error! Traceback (most recent call last): File "cloneultimate.py", line 54, in schedule.run_pending() File "/usr/local/lib/python3.6/site-packages/schedule/init.py", line 493, in run_pending default_scheduler.run_pending() File "/usr/local/lib/python3.6/site-packages/schedule/init.py", line 78, in run_pending self._run_job(job) File "/usr/local/lib/python3.6/site-packages/schedule/init.py", line 131, in _run_job ret = job.run() File "/usr/local/lib/python3.6/site-packages/schedule/init.py", line 411, in run ret = self.job_func() File "cloneultimate.py", line 34, in follow_users_from_hastag_file bot.follow_users(bot.get_hashtag_users(random_hashtag_file.random())) File "/usr/local/lib/python3.6/site-packages/instabot/bot/bot.py", line 318, in get_hashtag_users return get_hashtag_users(self, hashtag) File "/usr/local/lib/python3.6/site-packages/instabot/bot/bot_get.py", line 127, in get_hashtag_users return [str(i['user']['pk']) for i in self.api.last_json['items']] File "/usr/local/lib/python3.6/site-packages/instabot/bot/bot_get.py", line 127, in return [str(i['user']['pk']) for i in self.api.last_json['items']] KeyError: 'user' 2018-06-23 06:40:02,662 - INFO - Bot stopped. Worked: 6:37:52.666242 2018-06-23 06:40:02,662 - INFO - Total likes: 99 2018-06-23 06:40:02,662 - INFO - Total requests: 2323


-- coding: utf-8 --

from glob import glob import os import sys import threading import time

sys.path.append(os.path.join(sys.path[0], '../../')) import schedule from instabot import Bot, utils

import config

bot = Bot(comments_file=config.COMMENTS_FILE, blacklist_file=config.BLACKLIST_FILE, whitelist_file=config.WHITELIST_FILE, friends_file=config.FRIENDS_FILE, filter_business_accounts=False) bot.login() bot.logger.info("ULTIMATE script. Safe to run 24/7!")

random_user_file = utils.file(config.USERS_FILE) random_hashtag_file = utils.file(config.HASHTAGS_FILE)

def stats(): bot.save_user_stats(bot.user_id)

def like_timeline(): bot.like_timeline(amount=700 // 24)

def follow_users_from_hastag_file(): bot.follow_users(bot.get_hashtag_users(random_hashtag_file.random()))

def unfollow_non_followers(): bot.unfollow_non_followers(n_to_unfollows=config.NUMBER_OF_NON_FOLLOWERS_TO_UNFOLLOW)

schedule.every(9).minutes.do(stats) schedule.every(5).minutes.do(like_timeline) schedule.every(3).days.at("0:40").do(unfollow_non_followers) schedule.every(1).days.at("6:40").do(follow_users_from_hastag_file) schedule.every(3).days.at("12:40").do(unfollow_non_followers) schedule.every(1).days.at("17:40").do(follow_users_from_hastag_file)

while True: schedule.run_pending() time.sleep(1)

basnijholt commented 6 years ago

Can you try https://github.com/instagrambot/instabot/pull/575 ?

chadholman commented 6 years ago

@basnijholt api.py returns an error when including these lines: E0001:unindent does not match any outer indentation level (, line 647)

The file returns an error on open to begin wth: E1101:Instance of 'API' has no 'followers' member

basnijholt commented 6 years ago

How are you running it?

I think you are doing it wrong.

chadholman commented 6 years ago

@basnijholt i'm referring to the error in the attached. Otherwise the bot seems to be functioning in terminal when running my script. so far.

I'm running the same script across 3 accounts. Out of the two cases I posted today, my third process was still running ok.

screen shot 2018-06-23 at 10 59 01 am

basnijholt commented 6 years ago

I am sorry but you are the one that introduced the error there yourself.

Did you copy paste the code from GitHub or something?

You should checkout the repo with:

git checkout fix_545
chadholman commented 6 years ago

@basnijholt yes, thank you for pointing it out and have grabbed the latest.

basnijholt commented 6 years ago

Fixed by https://github.com/instagrambot/instabot/pull/575. Please make sure that you are really actually running the latest master before opening any new issues.