softcoder24 / insta_share

Share a post into your Instagram account using the requests library.
Other
27 stars 10 forks source link

KeyError in login_instagram #1

Closed chris-greening closed 3 years ago

chris-greening commented 3 years ago

The Problem

When trying to run login_instagram I got the following exception:

KeyError                                  Traceback (most recent call last)
<ipython-input-28-d4add1442034> in <module>
----> 1 login_instagram(username, password)

<ipython-input-27-f864dfe312a3> in login_instagram(username, password)
     31     json_data = json.loads(login_response.text)
     32
---> 33     if json_data["authenticated"]:
     34
     35         print("login successful")

KeyError: 'authenticated'

Environment/Steps to reproduce

Additional Info

I actually got referred here by someone over at this issue. I've seen similar solutions on Stack Overflow but haven't been able to find any success in getting in using only requests.post. I did some digging around in Instagram's AJAX and it definitely looks like they changed it relatively recently to make it harder for scraping/automating 😞

b31ngd3v commented 3 years ago

i added a pull request, probably in the next update you won't face that problem anymore. :)

chris-greening commented 3 years ago

i added a pull request, probably in the next update you won't face that problem anymore. :)

Awesome @b31ngD3v ! I'll take a look later today