Updated per backend change

This commit is contained in:
Anon 2023-03-19 19:27:22 -07:00
parent 208f897501
commit 1328845069

View File

@ -169,10 +169,12 @@ class YandereBot(FediBot.YandereBot):
else: else:
self.print_header_stats(None) self.print_header_stats(None)
def post(self): def post(self, callback=None):
picked = None
# Attempt post # Attempt post
try: try:
return super(YandereBot, self).post() picked = self.pick()
return super(YandereBot, self).post(lambda: picked)
# Invalid post (move to next profile) # Invalid post (move to next profile)
except FediBot.InvalidPost as e: except FediBot.InvalidPost as e:
@ -181,7 +183,8 @@ class YandereBot(FediBot.YandereBot):
# Invalid post (remove downloaded files) # Invalid post (remove downloaded files)
except (FileTooLarge, InvalidMimeType) as e: except (FileTooLarge, InvalidMimeType) as e:
os.remove(picked["full_path"]) if picked is not None:
os.remove(picked["full_path"])
print("Unable to post:", e) print("Unable to post:", e)
# Other Exceptions # Other Exceptions