diff options
author | jwansek <eddie.atten.ea29@gmail.com> | 2020-10-04 01:49:36 +0100 |
---|---|---|
committer | jwansek <eddie.atten.ea29@gmail.com> | 2020-10-04 01:49:36 +0100 |
commit | 55bfe256fb77dd083ab7283d795f8932938e73f1 (patch) | |
tree | 29cb800c82dd0d68ebeeb63f6442ff7dbde2d64e /bot.py | |
parent | b4817b94bd6d4c1e177fe55201bf0da0f335de75 (diff) | |
download | yaoi-communism-55bfe256fb77dd083ab7283d795f8932938e73f1.tar.gz yaoi-communism-55bfe256fb77dd083ab7283d795f8932938e73f1.zip |
fixed bug where pixiv links 403'd
Diffstat (limited to 'bot.py')
-rw-r--r-- | bot.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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})"
|