You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 9, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 9, 2024. It is now read-only.
usernameToUserId() receives JSON from Instagram where the first result doesn't match the username being sought, and because the function only checks the first index for the right user, you're getting the 'does not exist' result being returned.
Instagram could be returning the results in this order because the profiles that are being returned in higher order have paid to make themselves the highest priority result...?
A fix for Instatrack might be that the results being returned are iterated through until the right username is found, such as in the sample code below.
Activity
darylkell commentedon Mar 2, 2020
usernameToUserId() receives JSON from Instagram where the first result doesn't match the username being sought, and because the function only checks the first index for the right user, you're getting the 'does not exist' result being returned.
Instagram could be returning the results in this order because the profiles that are being returned in higher order have paid to make themselves the highest priority result...?
A fix for Instatrack might be that the results being returned are iterated through until the right username is found, such as in the sample code below.
`import requests
names = ["g.mi", "so_____y_", "glam.diva"]
for name in names:
data = requests.get(f"https://www.instagram.com/web/search/topsearch/?query={name}").json()
Output:
Name: g.mi
ID: 1283104053
Name: so_____y_
ID: 1065286586
Name: glam.diva
ID: 2113578179
Snbig commentedon Mar 2, 2020
Fixed by new commit: 7946c6c
@darylkell, Thank you for your editing suggestion.