mirror of
https://github.com/instaloader/instaloader.git
synced 2024-08-18 20:59:38 +02:00
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
|
||||
his/her username. To get said ID, given the profile's name, you may call this function."""
|
||||
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))
|
||||
return int(data['entry_data']['ProfilePage'][0]['user']['id'])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user