Skip to content
This repository has been archived by the owner on Jul 21, 2022. It is now read-only.

key errors #17

Closed
Qrh45timo opened this issue Apr 20, 2021 · 7 comments
Closed

key errors #17

Qrh45timo opened this issue Apr 20, 2021 · 7 comments

Comments

@Qrh45timo
Copy link

Generates key errors, relevant json is moved.
my tests:

import instagramy

hashtag = “…..”
post_id =. “…..”
user = “….”

ig_session_id = “….”

t = instagramy.InstagramHashTag(hashtag)
Error Info: <class 'KeyError'>: 'TagPage'

worked correctly for some days without login, now generates this error

t = instagramy.InstagramHashTag(hashtag, sessionid=ig_session_id)
Error Info: <class 'KeyError'>: 'graphql'

p = instagramy.InstagramPost(post_id, sessionid=ig_session_id)
Error Info: <class 'KeyError'>: 'graphql'

I think relevant post data moved to script block: window.__additionalDataLoaded

u = instagramy.InstagramUser(user, sessionid=ig_session_id)

this works correctly

@yogeshwaran01
Copy link
Owner

yogeshwaran01 commented Apr 21, 2021

@Qrh45timo Make sure your Instagram account is logged in with that sessionid. If you get this error go to browser login to Instagram and copy the new session id.

Thank You,

@Qrh45timo
Copy link
Author

logged into another browser for new session id. double checked session id, but didn't help - same errors.

@yogeshwaran01
Copy link
Owner

yogeshwaran01 commented Apr 22, 2021

@Qrh45timo It is perfect working for me.
Screenshot from 2021-04-22 09-42-14

check once the session id

session id sample

If you again not error please send your location (country name) and attach the output instagramy.html file of the following script

add your session id in session_id

from instagramy.core.requests import get

session_id = "add you session id"

html_source = get("https://www.instagram.com/github/", sessionid=session_id)

print(html_source)

file = open("instagram.html", 'w')
file.write(html_source)
file.close()

@Qrh45timo
Copy link
Author

done, still got error
country code = NL

1] html_source = get("https://www.instagram.com/github/", sessionid=session_id)
request_github.txt
but this request is for user, that seems to work.

2] result for test request post CN8UG5fj6KB:
html_source = get("https://www.instagram.com/p/CN8UG5fj6KB/", sessionid=session_id)

request_gisthub_post_CN8UG5fj6KB.txt

@yogeshwaran01
Copy link
Owner

@Qrh45timo, Thank you for your outputs

Instagram redirects you to login page in your country
you may try, Google Colab or any online interpreter. I think it work perfectly.

I try to fix this issue as soon as possible
Thank You

@Qrh45timo
Copy link
Author

thanks - let me know if you need some country-specific testing after fix :-)

@yogeshwaran01
Copy link
Owner

@Qrh45timo Sure Thank you

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants