yogeshwaran01 / instagramy

Python Package for Instagram Users, Posts, and Hashtag data.
https://pypi.org/project/instagramy
MIT License
151 stars 34 forks source link

PostPage empty, parsing update necessary? #10

Closed dekiesel closed 3 years ago

dekiesel commented 3 years ago

Hi,

I think Instagram changed something again.

I am using this code:

from instagramy import InstagramPost
sessionid='MYSESSIONID3AXFvgRizsd7NJNR%3A26'
code= 'CLt6RG7pfqk'
post= InstagramPost(code, sessionid = sessionid)

error:

Traceback (most recent call last):
  File "/home/john/python-code/webAPI/social_media/proj/qa/instaloot.py", line 4, in <module>
    post= InstagramPost(code, sessionid = sessionid)
  File "/home/john/.virtualenvs/some_proj/lib/python3.8/site-packages/instagramy/InstagramPost.py", line 56, in __init__
    raise RedirectionError
instagramy.core.exceptions.RedirectionError: Instagram Redirects you to login page, Try After Sometime or Reboot your PC Provide the sessionid to Login

I tried debugging a bit and I think it has to do with the parsing. PostPage is empty inside the dict returned by urllopen, but when I look at the post I see data for the right post, so I am guessing it's the parsing.

Unfortunately I don't know enough about HTML-parsing to fix it myself.

yogeshwaran01 commented 3 years ago

Thank you, @dekiesel for making this issue. I think it working fine

Screenshot from 2021-03-16 18-09-15

yogeshwaran01 commented 3 years ago

It is working :)

dekiesel commented 3 years ago

That's weird, I just tested my code snippet again and I am getting the same issue. Could I ask you to check with the post-id from my initial comment?

yogeshwaran01 commented 3 years ago

Screenshot from 2021-03-16 18-31-05 It is Working for this CLt6RG7pfqk post also

dekiesel commented 3 years ago

Thank you for trying. This is weird. PostPage is empty in the HTML I receive...

"[...]country_code":"US","language_code":"en","locale":"en_US","entry_data":{**"PostPage":[{}]}**,"hostname":"www.instagram.com","is_whitelisted_crawl_bot":false,"connection_quality_rating":"EXCELLENT"[...]

Thank you for your help, the issue seems to be somewhere else then.