instagrapi icon indicating copy to clipboard operation
instagrapi copied to clipboard

hashtag_medias_v1_chunk return duplicate cursor[BUG]

Open MohammadHosein21 opened this issue 2 years ago • 3 comments

Try Instagrapi SaaS with a free trial https://hikerapi.com/p/5GBWznd3

Describe the bug When I use this function to get information about the posts of a hashtag, it returns a duplicate cursor in some places, which causes duplicate posts to be saved.

To Reproduce In this section, it returns a duplicate cursor in some iterations while True: posts, cursor = cl.hashtag_medias_v1_chunk(hashtag, tab_key='recent', max_id=cursor) post_list.extend(posts)

Expected behavior For example, I expected that when I use this function, it will return all posts related to a hashtag without duplicates.

Desktop (please complete the following information):

  • OS: [windows 11]
  • Python version [3.10]
  • instagrapi version [2.0.0]

MohammadHosein21 avatar Sep 05 '23 06:09 MohammadHosein21

Same here !

Altimis avatar Nov 10 '23 15:11 Altimis

@adw0rd please we need a fix for this if you are available

Altimis avatar Nov 10 '23 15:11 Altimis

I solved it for myself by adding the tab parameter in the hashtag_medias_v1_chunk method in the hashtag.py file: Directories: My Ubuntu: /usr/local/lib/python3.10/dist-packages/instagrapi/mixins/hashtag.py My Windows: C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\site-packages\instagrapi\mixins\hashtag.py

image

Now the cursor no longer repeats itself!

davidrodma avatar Apr 25 '24 23:04 davidrodma