InstaPy / InstaPy

📷 Instagram Bot - Tool for automated Instagram interactions
GNU General Public License v3.0
16.73k stars 3.77k forks source link

How to confirm InstaPy is running properly #1470

Closed anthonyattard closed 5 years ago

anthonyattard commented 6 years ago

I'm looking for an automated method to confirming the bot is running as expected when automated with cron on a server. Something like another bot following some of the links that were interacted with and check if it actually did. A simpler method would be to have a notification sent out if the bot fails with an error.

Have has anyone come up with any methods to do this?

sionking commented 6 years ago

I done it complicated, but the simple solution is: Just every like update a json/pickle file with like amount and timestamp. From out side read this file and check every hour the timestamp is updated.

iFede94 commented 6 years ago

I have made something similar that sends me telegram messages in some cases I defined:

I'm using it because I have the script automated by cron and I need to see if the script is running correctly or not.

anthonyattard commented 6 years ago

@iFede94 How did you integrate InstaPy with cron and Telegram? Have any resources you'd recommend to accomplish this?

iFede94 commented 6 years ago

@anthonyattard The idea is to have the InstaPy script automated by cron and the python telegram bot running with it. When InstaPy script starts, it creates an instance of the bot so it can send messages to me. The telegram bot idea came from the one linked in the readme but mine can only send messages to allowed chat IDs and can't receive any command. Basically if you look at quickstart.py, I start the bot at the top of the run function and I send a message when starting and finishing every task or when any exception occurs. If you want today I can upload my code on github and create a readme on how to use it.

anthonyattard commented 6 years ago

@iFede94 Thanks that gives me some valuable pointers. A repo of your code would be great! Much appreciated.

iFede94 commented 6 years ago

You can find my repo here. You may need to change the path to get the general.log file because I'm using an old version of InstaPy and I don't know if they changed the path or not in the newer commits.

anthonyattard commented 6 years ago

@iFede94 Thanks so much!

stale[bot] commented 5 years ago

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

miguelrodriguezpro commented 5 years ago

It would be possible to notify me through telegram when finished and with the exacts Follows/unfollows/likes performed during the session? thanks!

miguelrodriguezpro commented 5 years ago

It would be possible to notify me through telegram when finished and with the exacts Follows/unfollows/likes performed during the session? thanks!

@iFede94

iFede94 commented 5 years ago

It would be possible to notify me through telegram when finished and with the exacts Follows/unfollows/likes performed during the session? thanks!

It was developed to work like this. My code is old so you should update it to reflect the changes made to InstaPy.

rajrpatel62499 commented 4 years ago

I am getting this bunch of errors while creating just instance of Instapy. Please help with this.

bot = InstaPy(username=insta_username,password=insta_password,headless_browser=False)

``C:\Users\rajrp\PycharmProjects\InstapyTrial\venv\Scripts\python.exe C:/Users/rajrp/PycharmProjects/InstapyTrial/InstapyTrial.py InstaPy Version: 0.6.8 .. .. .. .. .. .. .. .. .. .. .. .. .. .. Workspace in use: "C:/Users/rajrp/AppData/Roaming/SPB_Data/InstaPy" Traceback (most recent call last): File "C:/Users/rajrp/PycharmProjects/InstapyTrial/InstapyTrial.py", line 22, in bot = InstaPy(username=insta_username, File "C:\Users\rajrp\PycharmProjects\InstapyTrial\venv\lib\site-packages\instapy\instapy.py", line 309, in init self.browser, err_msg = set_selenium_local_session( File "C:\Users\rajrp\PycharmProjects\InstapyTrial\venv\lib\site-packages\instapy\browser.py", line 111, in set_selenium_local_session browser = webdriver.Firefox( File "C:\Users\rajrp\PycharmProjects\InstapyTrial\venv\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 170, in init RemoteWebDriver.init( File "C:\Users\rajrp\PycharmProjects\InstapyTrial\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in init self.start_session(capabilities, browser_profile) File "C:\Users\rajrp\PycharmProjects\InstapyTrial\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "C:\Users\rajrp\PycharmProjects\InstapyTrial\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute self.error_handler.check_response(response) File "C:\Users\rajrp\PycharmProjects\InstapyTrial\venv\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.SessionNotCreatedException: Message: Unable to find a matching set of capabilities

Viktor19931 commented 3 years ago

I got this error ` Starting InstaPy with quickstart

Traceback (most recent call last): File "../quickstart.py", line 2, in from instapy import InstaPy File "/Users/victor/Library/Python/2.7/lib/python/site-packages/instapy/init.py", line 3, in from .instapy import InstaPy File "/Users/victor/Library/Python/2.7/lib/python/site-packages/instapy/instapy.py", line 21, in except ModuleNotFoundError: NameError: name 'ModuleNotFoundError' is not defined `