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:
self.print_header_stats(None)
def post(self):
def post(self, callback=None):
picked = None
# Attempt post
try:
return super(YandereBot, self).post()
picked = self.pick()
return super(YandereBot, self).post(lambda: picked)
# Invalid post (move to next profile)
except FediBot.InvalidPost as e:
@ -181,6 +183,7 @@ class YandereBot(FediBot.YandereBot):
# Invalid post (remove downloaded files)
except (FileTooLarge, InvalidMimeType) as e:
if picked is not None:
os.remove(picked["full_path"])
print("Unable to post:", e)