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