mirror of
https://github.com/cquest/tootbot.git
synced 2025-05-05 10:33:34 +00:00
use access-token once retrived with login/pass
This commit is contained in:
parent
bea70c722c
commit
16212f800a
28
tootbot.py
28
tootbot.py
@ -100,19 +100,23 @@ if not os.path.isfile(instance+'.secret'):
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
mastodon_api = Mastodon(
|
mastodon_api = Mastodon(access_token=mastodon+".secret")
|
||||||
client_id=instance+'.secret',
|
|
||||||
api_base_url='https://'+instance
|
|
||||||
)
|
|
||||||
mastodon_api.log_in(
|
|
||||||
username=mastodon,
|
|
||||||
password=passwd,
|
|
||||||
scopes=['read', 'write'],
|
|
||||||
to_file=mastodon+".secret"
|
|
||||||
)
|
|
||||||
except:
|
except:
|
||||||
print("ERROR: First Login Failed!")
|
try:
|
||||||
sys.exit(1)
|
mastodon_api = Mastodon(
|
||||||
|
client_id=instance+'.secret',
|
||||||
|
api_base_url='https://'+instance
|
||||||
|
)
|
||||||
|
print('login')
|
||||||
|
mastodon_api.log_in(
|
||||||
|
username=mastodon,
|
||||||
|
password=passwd,
|
||||||
|
scopes=['read', 'write'],
|
||||||
|
to_file=mastodon+".secret"
|
||||||
|
)
|
||||||
|
except:
|
||||||
|
print("ERROR: First Login Failed!")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
print(source)
|
print(source)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user