removed neuter settings
This commit is contained in:
12
bot.py
12
bot.py
@@ -3,7 +3,7 @@ import logging
|
||||
|
||||
# Mastodon bot to post things
|
||||
class bot():
|
||||
def __init__(self, config, neuter=False):
|
||||
def __init__(self, config):
|
||||
self.masto = Mastodon(access_token=config["mastodon"]["access_token"], api_base_url=config["mastodon"]["host"])
|
||||
|
||||
# uploads media to mastodon, returns the mastodon ID
|
||||
@@ -16,15 +16,9 @@ class bot():
|
||||
def upload_all_media(self, filenames):
|
||||
ids = []
|
||||
for fn in filenames:
|
||||
if not self.neuter:
|
||||
ids.append(self.upload_media(fn))
|
||||
else:
|
||||
print(f"Would have uploaded {fn}")
|
||||
ids.append(self.upload_media(fn))
|
||||
return ids
|
||||
|
||||
def toot(self, text, media=None):
|
||||
logging.info(f"Posting:\n Text: {text}")
|
||||
if not self.neuter:
|
||||
self.masto.status_post(text, media_ids=media)
|
||||
else:
|
||||
print(f"Would have tooted: {text}")
|
||||
self.masto.status_post(text, media_ids=media)
|
||||
|
||||
@@ -35,7 +35,7 @@ class scraper:
|
||||
# downloads a given post's media and return the locations
|
||||
def download(self, post):
|
||||
logging.info(f"Downloading {post.id}... ")
|
||||
result = [] #self.login.download(post) neuter
|
||||
self.login.download(post)
|
||||
logging.info(f"Done downloading {post.id}.")
|
||||
return result
|
||||
|
||||
|
||||
Reference in New Issue
Block a user