Updated per backend change
This commit is contained in:
parent
208f897501
commit
1328845069
@ -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,7 +183,8 @@ class YandereBot(FediBot.YandereBot):
|
||||
|
||||
# Invalid post (remove downloaded files)
|
||||
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)
|
||||
|
||||
# Other Exceptions
|
||||
|
Reference in New Issue
Block a user