I'm having problems with instabot. I want to upload an image but it gives me an error
My code:
bot = Bot()
bot.login(username=username, password=password)
bot.upload_photo(image,caption='title')
Error:
line 23, in <module> bot.login(username=username, password=password)
line 443, in login if self.api.login(**args) is False
line 240, in login self.load_uuid_and_cookie(load_cookie=use_cookie, load_uuid=use_uuid)
line 199, in load_uuid_and_cookie return load_uuid_and_cookie(self, load_uuid=load_uuid, load_cookie=load_cookie)
line 352, in load_uuid_and_cookie
cookie_username = self.cookie_dict["ds_user"]
KeyError: 'ds_user'
From what I understood the part that makes the cookie does not write details about the user. so I recommend deleting the the json file in the config directory at the start of your code:
import os
import glob
cookie_del = glob.glob("config/*cookie.json")
os.remove(cookie_del[0])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With