Closed mispp closed 1 year ago
Hm! Could you post the code you are running? What does the full call to create_app look like?
#!/bin/python3
import argparse
from mastodon import Mastodon
api_base_url = 'http://localhost:8080',
bot_clientcred = 'bot_clientcred.secret'
Mastodon.create_app(
'bot',
api_base_url = api_base_url,
to_file = bot_clientcred
)
you have a stray comma on the line
api_base_url = 'http://localhost:8080',
which makes it equivalent to
api_base_url = ('http://localhost:8080', )
please remove the comma and try again
thanks @codl
i cant believe i missed that...
Found a possible bug: making a bot in the same VM as the gotosocial instance and connecting locally via http.
Traceback (most recent call last): File "/opt/bot/scripts/./bot-01-define-app.py", line 10, in
Mastodon.create_app(
File "/home/bot/.local/lib/python3.10/site-packages/mastodon/authentication.py", line 50, in create_app
api_base_url = Mastodon.protocolize(api_base_url)
File "/home/bot/.local/lib/python3.10/site-packages/mastodon/internals.py", line 646, in protocolize
if not base_url.startswith("http://") and not base_url.startswith("https://"):