OlegYurchik / pyInstagram

This is a simple and easy-to-use library for interacting with the Instagram. The library works through the web interface of the Instagram and does not depend on the official API
MIT License
232 stars 49 forks source link

listing all comments #33

Closed apexible closed 5 years ago

apexible commented 5 years ago

hi oleg,

i am trying listing all comments on a post, for example 20.000 comments. i am getting 429 error. i think pointer fixes this problem. but i dont understand using pointer, can you give me a example for using pointer in listing all comments

thank you

OlegYurchik commented 5 years ago

429 error - it is error with name "Too Many Requests", pointer can fix this problem if you will add delays for your requests. Example:

from instaparser.agents import Agent
from instaparser.entities import Media
from time import sleep

agent = Agent()
media = Media("Bse7LQqBeOv")
comments, pointer = agent.get_comments(media, count=100)
while not pointer is None:
    comments, pointer = agent.get_comments(media, pointer=pointer, count=100)
    print(comments)
    sleep(2)