subzeroid / instagrapi

🔥 The fastest and powerful Python library for Instagram Private API 2024
https://hikerapi.com/p/bkXQlaVe
MIT License
4.37k stars 684 forks source link

medias = cl.hashtag_medias_recent('downhill', amount=2) [BUG] #1591

Open TimoZuerner opened 1 year ago

TimoZuerner commented 1 year ago

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

Getting a Key Error when trying a function for Hashtags

medias = cl.hashtag_medias_a1(name='test', amount=40, tab_key="recent")

Error: Traceback (most recent call last):

File "....\main.py", line 59, in medias = cl.hashtag_medias_a1(name='test', amount=40, tab_key="recent") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "....\venv\Lib\site-packages\instagrapi\mixins\hashtag.py", line 222, in hashtag_mediasa1 medias, = self.hashtag_medias_a1_chunk(name, amount, tab_key) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "....\venv\Lib\site-packages\instagrapi\mixins\hashtag.py", line 179, in hashtag_medias_a1_chunk result = data["data"][tab_key]



KeyError: 'data'

**Desktop :**
 - OS: Windows
 - Python version 3.11
 - instagrapi version: grapi-0.1.4

**Additional context**
Also key error with this code:
`medias = cl.hashtag_medias_recent('downhill', amount=2)`
blackaquaindia commented 1 year ago

i got this same error since last day i checked it its not working medias = cl.hashtag_medias_recent('downhill', amount=2)

BourhaneYounes commented 1 year ago

It's the same with hashtag_medias_top(), the other methods work fine but these two keep giving a "Key error"