Hello, I want to run the bot unlimeted. After an Hour the Bot says "Session Ended".
Hello.
Just add to into #actions section this:
for cycle in range(10):
print("\n\nLOOP {}\n".format(cycle+1))
# session.interact_user_followers(['worldcode', 'creativroom', 'thebeeest'], amount=100, randomize=True)
time.sleep(50) #take a 50 seconds of break after finishing the feature above
session.unfollow_users(amount=20, sleep_delay=60 )
time.sleep(30) #take some more break after finishing unfollows
session.like_by_tags(['webdesign', 'coding', 'frontend'], amount=30)
time.sleep(60)
session.follow_by_tags(['webdesign', 'coding', 'frontend'], amount=30)
where, for cycle in range(10): is number of cycles.
but this is not 24/7 if I use cycles ?
I have this error 馃拑
:~/InstaPy$ python3 quickstart.py
File "quickstart.py", line 41
for cycle in range(10):
^
SyntaxError: invalid syntax
Please send your code. Thats an SyntaxError so probably you indent the code wrong
Here is my Quickstart.py
@karlsruhegraphy
ok, so if Exception (error) occurs, finally: will repeat def from the start:
def Job():
try:
session.login()
# settings
session.set_relationship_bounds(enabled=True,
potency_ratio=-1.21,
delimit_by_numbers=True,
max_followers=4590,
max_following=5555,
min_followers=45,
min_following=77)
session.set_do_comment(True, percentage=20)
session.set_do_follow(True, percentage=80)
session.set_comments(['Great work!', 'So much fun!!', 'Nice!!' , 'Well done! :)', 'Good job! :))'])
# actions
for cycle in range(20):
print("\n\nLOOP {}\n".format(cycle+1))
# session.interact_user_followers(['worldcode', 'creativroom', 'thebeeest'], amount=100, randomize=True)
time.sleep(50) #take a 50 seconds of break after finishing the feature above
# session.unfollow_users(amount=60, InstapyFollowed=(True), style="FIFO", sleep_delay=501)
session.unfollow_users(amount=40, allFollowing=True, style="LIFO", unfollow_after=3*60*60, sleep_delay=450)
time.sleep(30) #take some more break after finishing unfollows
session.like_by_tags(['webdesign', 'coding', 'frontend'], amount=20)
# time.sleep(60)
# session.follow_by_tags(['webdesign', 'coding', 'frontend'], amount=30)
except Exception as exc:
# if changes to IG layout, upload the file to help us locate the change
if isinstance(exc, NoSuchElementException):
file_path = os.path.join(gettempdir(), '{}.html'.format(time.strftime('%Y%m%d-%H%M%S')))
with open(file_path, 'wb') as fp:
fp.write(session.browser.page_source.encode('utf8'))
print('{0}\nIf raising an issue, please also upload the file located at:\n{1}\n{0}'.format(
'*' * 70, file_path))
# full stacktrace when raising Github issue
raise
# pass
finally:
# end the bot session
# session.end()
Job()
Job()
@karlsruhegraphy just posted your username and pw in the zip lol
this is not my real password :)
it is/was
can you help me with the code?
ubuntu@ip-172-31-43-2:~/InstaPy$ python3 quickstart.py
File "quickstart.py", line 35
session.set_do_comment(True, percentage=10)
^
whats that ? :D
Hello
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. > If this problem still occurs, please open a new issue