1

I used Mastodon.py and successfully had connected to a Mastodon instance using user/password.

But what I really need is to connect to a Pixelfed instance. Reading documentation from Pixelfed it's said you can connect to it like you do with Mastodon, just with some caveats, like (if I understood alright) you can only do this with a Personal Token or OAuth2.

As I don't need (or have to) an OAuth2 way to connect, as what I'm trying to do is upload a sizable number of pictures into my Pixelfed profile, I tried to use either user/pass and user/Personal Token...

But the same crashes.

I created my server connect object and tried to run this code on this gist with the results there...

https://gist.github.com/fabiocosta0305/4638c6413be9ef7c5588cb337ab11a19

api.log_in("fabiocosta0305@gmail.com","<password>",scopes=['read','write','follow','push'])

Traceback (most recent call last):
  File "/home/s192199488/.local/lib/python3.10/site-packages/mastodon/authentication.py", line 322, in log_in
    response = self.__api_request('POST', '/oauth/token', params, do_ratelimiting=False)
  File "/home/s192199488/.local/lib/python3.10/site-packages/mastodon/internals.py", line 299, in __api_request
    raise ex_type('Mastodon API returned error', response_object.status_code, response_object.reason, error_msg)
mastodon.errors.MastodonUnauthorizedError: ('Mastodon API returned error', 401, 'Unauthorized', 'invalid_client')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/s192199488/.local/lib/python3.10/site-packages/mastodon/authentication.py", line 328, in log_in
    raise MastodonIllegalArgumentError('Invalid user name, password, or redirect_uris: %s' % e)
mastodon.errors.MastodonIllegalArgumentError: Invalid user name, password, or redirect_uris: ('Mastodon API returned error', 401, 'Unauthorized', 'invalid_client')

Any tips?

HufflepuffBR
  • 443
  • 3
  • 15

0 Answers0