aboutsummaryrefslogtreecommitdiffstats
path: root/bot.py
diff options
context:
space:
mode:
authorjwansek <eddie.atten.ea29@gmail.com>2020-10-04 01:49:36 +0100
committerjwansek <eddie.atten.ea29@gmail.com>2020-10-04 01:49:36 +0100
commit55bfe256fb77dd083ab7283d795f8932938e73f1 (patch)
tree29cb800c82dd0d68ebeeb63f6442ff7dbde2d64e /bot.py
parentb4817b94bd6d4c1e177fe55201bf0da0f335de75 (diff)
downloadyaoi-communism-55bfe256fb77dd083ab7283d795f8932938e73f1.tar.gz
yaoi-communism-55bfe256fb77dd083ab7283d795f8932938e73f1.zip
fixed bug where pixiv links 403'd
Diffstat (limited to 'bot.py')
-rw-r--r--bot.py5
1 files changed, 4 insertions, 1 deletions
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})"