fix get_id_by_username()
This commit is contained in:
parent
61711f3b6d
commit
00f6f47fa9
@ -101,7 +101,7 @@ def get_id_by_username(profile: str) -> int:
|
|||||||
"""Each Instagram profile has its own unique ID which stays unmodified even if a user changes
|
"""Each Instagram profile has its own unique ID which stays unmodified even if a user changes
|
||||||
his/her username. To get said ID, given the profile's name, you may call this function."""
|
his/her username. To get said ID, given the profile's name, you may call this function."""
|
||||||
data = get_json(profile, get_anonymous_session())
|
data = get_json(profile, get_anonymous_session())
|
||||||
if len(data["entry_data"]) == 0 or "ProfilePage" not in data("entry_data"):
|
if len(data["entry_data"]) == 0 or "ProfilePage" not in data["entry_data"]:
|
||||||
raise ProfileNotExistsException("Profile {0} does not exist.".format(profile))
|
raise ProfileNotExistsException("Profile {0} does not exist.".format(profile))
|
||||||
return int(data['entry_data']['ProfilePage'][0]['user']['id'])
|
return int(data['entry_data']['ProfilePage'][0]['user']['id'])
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user