Ensta icon indicating copy to clipboard operation
Ensta copied to clipboard

Couldn't find an account with the username...

Open Piero24 opened this issue 1 year ago • 2 comments

I'm trying to use Ensta to print the list of followers from the profile, but unfortunately, I'm getting the following problem.

from ensta import Mobile

mobile = Mobile("Username", "Password")

followers = mobile.followers("leomessi", 10)
followings = mobile.followings("leomessi", 10)

for user in followers.list:
    print(user.full_name)

for user in followings.list:
    print(user.full_name)

# Fetching next chunk
followers = mobile.followers(
    "Username",
    next_cursor=followers.next_cursor
)
Traceback (most recent call last):
  File "/Users/User/Documents/test.py", line 5, in <module>
    mobile = Mobile("Username", "Password")
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/User/Documents/env/lib/python3.12/site-packages/ensta/Mobile.py", line 72, in __init__
    self.refresh_credentials(
  File "/Users/User/Documents/env/lib/python3.12/site-packages/ensta/Mobile.py", line 103, in refresh_credentials
    self.credentials = Credentials(
                       ^^^^^^^^^^^^
  File "/Users/User/Documents/env/lib/python3.12/site-packages/ensta/Credentials.py", line 73, in __init__
    self.login(identifier, password, save_folder)
  File "/Users/User/Documents/env/lib/python3.12/site-packages/ensta/Credentials.py", line 122, in login
    raise AuthenticationError(
ensta.lib.Exceptions.AuthenticationError: Login failed with given credentials.
Response: {'message': "We couldn't find an account with the username Username. Check the username you entered and try again.", 'status': 'fail', 'error_title': 'Username Not Found', 'buttons': [{'title': 'Try Again', 'action': 'dismiss'}, {'title': 'Recover Your Account', 'action': 'show_recovery_challenge'}], 'invalid_credentials': True, 'exception_name': 'UserInvalidCredentials'}

I've tried using Web instead of Mobile as mentioned here but it seems that there is no option to return the followers.

What can I do to resolve this?

Piero24 avatar May 21 '24 17:05 Piero24

It's trying to log in as "Username" with password "Password"

Presumably you realize you have to replace these?

huttphil avatar Sep 29 '24 19:09 huttphil

Hi @huttphil, yes I have replaced them. I have used "Username", "Password" just for posting the error here.

Piero24 avatar Sep 29 '24 20:09 Piero24