Updated per backend change
This commit is contained in:
parent
208f897501
commit
1328845069
@ -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,6 +183,7 @@ class YandereBot(FediBot.YandereBot):
|
|||||||
|
|
||||||
# Invalid post (remove downloaded files)
|
# Invalid post (remove downloaded files)
|
||||||
except (FileTooLarge, InvalidMimeType) as e:
|
except (FileTooLarge, InvalidMimeType) as e:
|
||||||
|
if picked is not None:
|
||||||
os.remove(picked["full_path"])
|
os.remove(picked["full_path"])
|
||||||
print("Unable to post:", e)
|
print("Unable to post:", e)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user