Skip to content
This repository was archived by the owner on Sep 9, 2024. It is now read-only.
This repository was archived by the owner on Sep 9, 2024. It is now read-only.

'Username does not exist' on some accounts #11

Closed

Description

@rEnr3n
$ python --version
Python 3.8.1
$ python InstaTracker.py -u g.mi
[-] Username does not exist
$ python InstaTracker.py -u 'g.mi'
[-] Username does not exist
$ python InstaTracker.py -u so_____y_
[-] Username does not exist
$ python InstaTracker.py -u 'so_____y_'
[-] Username does not exist
$ python InstaTracker.py -u _glam.diva_
[-] Username does not exist
$ python InstaTracker.py -u '_glam.diva_'
[-] Username does not exist

Activity

  1. darylkell commented on Mar 2, 2020

    @darylkell

    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()

    for user_data in data["users"]:
    	if user_data["user"]["username"] == name:
    		print(f"Name: {name}\nID: {user_data['user']['pk']}\n")`
    

    Output:
    Name: g.mi
    ID: 1283104053

    Name: so_____y_
    ID: 1065286586

    Name: glam.diva
    ID: 2113578179

  2. added
    bug
    on Mar 2, 2020
  3. Snbig commented on Mar 2, 2020

    @Snbig
    Owner

    Fixed by new commit: 7946c6c
    @darylkell, Thank you for your editing suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions