Giter VIP home page Giter VIP logo

instagram-monitor's Introduction

Instagram Monitor

This is a python program that uses instaloader to monitor instagram profiles every X interval.

instagram-monitor's People

Contributors

peppapig450 avatar

Watchers

 avatar  avatar

instagram-monitor's Issues

Handling the 401 errors

Error:

instaloader.exceptions.ConnectionException: JSON Query to graphql/query: HTTP error code 401.

Description:

After a certain amount of time since the initial session creation, the program encounters a ConnectionException with an HTTP error code 401 (Unauthorized). This suggests an authentication issue.

Analysis:

Based on investigation of instaloader's issues, it's possible that the program is relying on a session file that becomes invalid after some time. This could be causing the authentication error. My other theory is that after a certain amount of requests a new session is needed, possibly due to session id.

Possible Solutions

  1. Automatic Session Recreation:
  • Implement functionality to automatically recreate the instaloader session at regular intervals or when the 401 connection error is encountered.
    • This could be done either reading the file creation, and access times (not sure how well that works cross platform) or by reading the log file for when it was created and comparing with the current date.
    • I'd guess that a good time for session re-creation would be 24 hours.
  • This should hopefully ensure that the credentials are not stale and the requests would be valid.
  1. Investigate Instaloader issues further:
  • Look at more instaloader issues about 401 errors, seeing if anyone has a solution to it, and if they do how that solution can be applied to this program.
  1. Error Handling and Retrying:
  • Catch the ConnectionException where it occurs and then recreate an instaloader session using browser cookies and retry the program
  • If the retried request occurs again, catch the ConnectionException and gracefully exit.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.