shine-jayakumar / insta-likecom-bot

Automates likes and comments on an instagram account or tag
MIT License
136 stars 29 forks source link

Unable to run the script, seems like the issue with AppLogger(__name__).getlogger() #91

Closed timetraveler90 closed 1 year ago

timetraveler90 commented 1 year ago

When i tried to run the following command: ilcbot.py -u yourusername -p yourpassword -t thetarget -bp '/path/to/Profile 1'

but with my credentials and path to profile, here is the error that I encountered:

Traceback (most recent call last):
  File "/Users/abcd/Desktop/insta-likecom-bot-master/ilcbot.py", line 14, in <module>
    from modules.instance import *
  File "/Users/abcd/Desktop/insta-likecom-bot-master/modules/instafunc.py", line 52, in <module>
    logger = AppLogger(__name__).getlogger()
  File "/Users/abcd/Desktop/insta-likecom-bot-master/modules/applogger.py", line 35, in __init__
    file_handler = TimedRotatingFileHandler(logfname, when='midnight')
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/logging/handlers.py", line 208, in __init__
    BaseRotatingHandler.__init__(self, filename, 'a', encoding=encoding,
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/logging/handlers.py", line 58, in __init__
    logging.FileHandler.__init__(self, filename, mode=mode,
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/logging/__init__.py", line 1146, in __init__
    StreamHandler.__init__(self, self._open())
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/logging/__init__.py", line 1175, in _open
    return open(self.baseFilename, self.mode, encoding=self.encoding,
FileNotFoundError: [Errno 2] No such file or directory: '/Users/abcd/Desktop/insta-likecom-bot-master/logs/instalikecombot_2023_09_03.log'
shine-jayakumar commented 1 year ago

@timetraveler90 Check if the 'logs' directory exists or not. If not, create a directory named 'logs' and run the script again.