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

A few questions #36

Closed ghost closed 5 years ago

ghost commented 5 years ago

Hi there! Could you explain me what mean of parameter count ?

count - number of last media records

and how I can define useragent for requests?

OlegYurchik commented 5 years ago

Hi! count - it is a count of medias what are you want to take from account/tag/location

You can define useragent like that:

from instaparser.agents import Agent
from instaparser.entities import Account

settings = {
    "headers": {
        "User-Agent": "My User Agent",
    },
}
agent = Agent(settings=settings)
account = Account("zuck")
last_20_medias, pointer = agent.get_media(account, count=20, settings=settings)

This example return list of 20 medias to 'last_20_medias'

ghost commented 5 years ago

Thank you so much, Oleg!

Then what is it about "Limit"?

count - number of last likes records limit - limit of likes in one request

For ex. account = 'abracadababababa' agent = Agent()

PostID = 'BjSWQRKAuXd' m = Media(PostID) feedlikes, nextlike = agent.get_likes(media=m, count=30, limit=5, delay=10)

I expect the request will return 5 records from 30 that was requested I should call request 6 time (6 x 5, with pointer = nextlike) for retrieving all records

But the request return 30 records without the influence of parameter limit

OlegYurchik commented 5 years ago

Limit is a count records for one request, count - count of all records what you need. This code do 6 request and return to you 30 records