instagram_private_api icon indicating copy to clipboard operation
instagram_private_api copied to clipboard

story_viewers() returns only 20 viewers, not all of them

Open kritonpc opened this issue 4 years ago • 1 comments

Please follow the guide below

  • Issues submitted without this template format will be ignored.
  • Please read the questions carefully and answer completely.
  • Do not post screenshots of error messages or code.
  • Put an x into all the boxes [ ] relevant to your issue (==> [x] NO spaces).
  • Use the Preview tab to see how your issue will actually look like.
  • Issues about reverse engineering is out of scope and will be closed without response.
  • Any mention of spam-like actions or spam-related tools/libs/etc is strictly not allowed.

Before submitting an issue, make sure you have:

  • [x] Updated to the lastest version v1.6.0
  • [x] Read the README and docs
  • [x] Searched the bugtracker for similar issues including closed ones
  • [x] Reviewed the sample code in tests and examples

Which client are you using?

  • [x] app (instagram_private_api/)
  • [ ] web (instagram_web_api/)

Describe the Bug/Error:

I am trying to get the names of all viewers of a story, but for some reason the story_viewers() method only returns 20. Is there a way to get the full list of viewers?


Paste the output of python -V here:

Code:

from instagram_private_api import Client, ClientCompatPatch

user_name = 'XXXXX'
password = 'XXXXXXX'

api = Client(user_name, password)
userid = api.authenticated_user_id
results = api.feed_timeline()
items = results.get('items', [])
# print(api.user_story_feed(userid).get('items', []))
story = api.story_viewers(XXXXXXXXXXXXXXXXXXXX).get('users',[])
print(len(story))

Error/Debug Log:

The output is 20

kritonpc avatar Sep 07 '20 00:09 kritonpc

Hi @kritonpc

Check https://instagram-private-api.readthedocs.io/en/latest/api.html#instagram_private_api.Client.story_viewers

should work something like this story = api.story_viewers(XXXXXXXXXXXXXXXXXXXX) next_story = api.story_viewers(XXXXXXXXXXXXXXXXXXXX, max_id=story['next_max_id'])

MaximBoyarskiy avatar Dec 13 '20 15:12 MaximBoyarskiy