InstaBot icon indicating copy to clipboard operation
InstaBot copied to clipboard

Caption has suddenly stopped working

Open v3lip opened this issue 5 years ago • 2 comments

Captions worked for my first pics, but now it has suddenly stopped working for some reason. I made a new Python-script to test this, and it doesn't work here either. The image gets uploaded, but there's no caption. Here's the code:

from instabot import Bot
from PIL import Image
import random, os, time, json

data = json.loads(open('config.json').read())
bot = Bot()
bot.login(  username = data['username'],
            password = data['password'])


print(' >>> Starting Bot..')

image = random.choice(os.listdir('rips/reddit_sub_memes/'))
bot.upload_photo('rips/reddit_sub_memes/' + image, 
                              caption="Test Caption")

- Kind regards

v3lip avatar Sep 05 '20 23:09 v3lip

Same +1

Edit:

I might have found a quick and dirty fix: go through all functions which upload_photo calls and also provide the caption as argument. In the defintions of those functions remove the default value for caption which is always "" or None. Probably somewhere in the calling of the function the original caption is lost and replace by the default empty caption.

Edit2: nope, it broke again

UndercoverButter avatar Nov 02 '20 15:11 UndercoverButter

Same +1 happened today :(

andyzasl avatar Jul 27 '21 22:07 andyzasl