Open asterismo opened 6 years ago
Same issue here, different error:
What is the password ?xxxxxxxxxxxx
What is your instance ?mastodon.xxx
What is your botname ?federationbot
Traceback (most recent call last):
File "Autofollow.py", line 30, in <module>
to_file = '.pytooter_usercred.txt'
File "/home/federation-bot/mastodon-autofollow/.venv/local/lib/python2.7/site-packages/mastodon/Mastodon.py", line 420, in log_in
raise MastodonIllegalArgumentError('Invalid user name, password, or redirect_uris: %s' % e)
mastodon.Mastodon.MastodonIllegalArgumentError: Invalid user name, password, or redirect_uris: ('Mastodon API returned error', 401, 'Unauthorized', u'invalid_grant')
Aside from the error, it would be good to have an idea of what values are actually expected here. Are these the details of our bot? Do we need to prefix https:// in front of the instance name? I'm assuming there's no @ in the username.
I also see that there's a hardcoded INSTANCE='https://mastodon.host'
in Autofollow.py. Does that need to be changed to the name of our own instance?
You know that thing where you post in a Github issue and then, just after posting, realise the issue might be with something else?
The errors we're getting are from Mastodon.py. In the code's comments it notes:
The username is the e-mail used to log in into mastodon.
I've used my (bot's) registered email address in the format mailbox@domain.tld, its password from the Mastodon instance, the instance name with https:// and launch.sh now runs. Not sure if it's doing anything, but it's running.
I've changed INSTANCES in Autofollow.py to my instance name (not sure what this does), and by setting DEBUG=TRUE I can see plenty of activity.
Remember that if you've already entered details you'll need to delete any hidden .pytooter_clientcred.txt or .pytooter_usercred.txt files before running the script again.
An update to this, INSTANCES in Autofollow.py appears to be the instance the script authenticates against, so set it your instance before you run anything. I'm not sure what the instance the script collects as user input is for.
What i'm doing wrong?
sh ./launch.sh [12/218] Running virtualenv with interpreter /usr/bin/python2 New python executable in .venv/bin/python2 Also creating executable in .venv/bin/python Installing setuptools, pip...done. Downloading/unpacking Mastodon.py Downloading Mastodon.py-1.2.1-py2.py3-none-any.whl Downloading/unpacking requests (from Mastodon.py) Downloading requests-2.18.4-py2.py3-none-any.whl (88kB): 88kB downloaded Downloading/unpacking python-dateutil (from Mastodon.py) Downloading python_dateutil-2.6.1-py2.py3-none-any.whl (194kB): 194kB downloaded Downloading/unpacking six (from Mastodon.py) Downloading six-1.11.0-py2.py3-none-any.whl Downloading/unpacking decorator (from Mastodon.py) Downloading decorator-4.2.1-py2.py3-none-any.whl Downloading/unpacking pytz (from Mastodon.py) Downloading pytz-2017.3-py2.py3-none-any.whl (511kB): 511kB downloaded Downloading/unpacking certifi>=2017.4.17 (from requests->Mastodon.py) Downloading certifi-2018.1.18-py2.py3-none-any.whl (151kB): 151kB downloaded Downloading/unpacking idna>=2.5,<2.7 (from requests->Mastodon.py) Downloading idna-2.6-py2.py3-none-any.whl (56kB): 56kB downloaded Downloading/unpacking chardet>=3.0.2,<3.1.0 (from requests->Mastodon.py) Downloading chardet-3.0.4-py2.py3-none-any.whl (133kB): 133kB downloaded Downloading/unpacking urllib3>=1.21.1,<1.23 (from requests->Mastodon.py) Downloading urllib3-1.22-py2.py3-none-any.whl (132kB): 132kB downloaded Installing collected packages: Mastodon.py, requests, python-dateutil, six, decorator, pytz, certifi, idna, chardet, urllib3 Successfully installed Mastodon.py requests python-dateutil six decorator pytz certifi idna chardet urllib3 Cleaning up... What is the username ?followbot What is the password ?xxxxxxxxxxxx What is your instance ?https://mastodon.instance What is your botname ?Followbot Traceback (most recent call last): File "Autofollow.py", line 30, in
to_file = '.pytooter_usercred.txt'
File "/home/admin/mastodon-autofollow/.venv/local/lib/python2.7/site-packages/mastodon/Mastodon.py", line 325, in log_in
raise MastodonIllegalArgumentError('Invalid user name, password, or redirect_uris: %s' % e)
mastodon.Mastodon.MastodonIllegalArgumentError: Invalid user name, password, or redirect_uris: Mastodon API returned error: invalid_client