From 55bfe256fb77dd083ab7283d795f8932938e73f1 Mon Sep 17 00:00:00 2001 From: jwansek Date: Sun, 4 Oct 2020 01:49:36 +0100 Subject: fixed bug where pixiv links 403'd --- bot.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'bot.py') diff --git a/bot.py b/bot.py index 7e3c6f7..3c8f6e0 100644 --- a/bot.py +++ b/bot.py @@ -7,7 +7,10 @@ import get_images twitter = Twython(*get_images.CONFIG["twitterapi"].values()) def post(): - impath, source, text = get_images.main() + images = get_images.main() + while images is None: + images = get_images.main() + impath, source, text = images with open(impath, "rb") as img: response = twitter.upload_media(media = img) message = f"{text} ({source})" -- cgit v1.2.3