blob: 659d232f76a398531b883bc198f50bfd586cf428 (
plain) (
tree)
|
|
from mastodon import Mastodon
from config import TOOT_API_BASE_URL, TOOT_CLIENT_SECRET, TOOT_ACCESS_TOKEN, TOOT_CLIENT_ID, MASTODON_CLIENT_ID_FILE
'''
https://mastodonpy.readthedocs.io/en/stable/index.html
'''
mastodon_client = Mastodon(client_id=MASTODON_CLIENT_ID_FILE,
api_base_url=TOOT_API_BASE_URL)
url = mastodon_client.auth_request_url(redirect_uris="https://zjw.social/checkinbot/fedi_login_callback", scopes=['write:media', 'write:statuses'])
print(url)
# mastodon_client.log_in(
# username="[email protected]",
# code='2RnDpj9lMGLWuIeppl-Cghy-iwSXzlJFWU6mQaKYD9o',
# # redirect_uri="urn:ietf:wg:oauth:2.0:oob",
# scopes=['write:media', 'write:statuses']
# )
|