Closed heyton closed 6 years ago
Please try this!
from instabot import Bot
bot = Bot()
bot.login()
path = "xyz.jpg"
text = "Hello!"
bot.uploadPhoto(path, text)
@iamjagjeetubhi get error
Traceback (most recent call last): File "upload_photo.py", line 10, in
bot.upload_photo(path, text) File "/usr/local/lib/python2.7/site-packages/instabot/bot/bot.py", line 351, in upload_photo return upload_photo(self, photo, caption, upload_id) File "/usr/local/lib/python2.7/site-packages/instabot/bot/bot_photo.py", line 9, in upload_photo if super(self.class, self).uploadPhoto(photo, caption, upload_id): File "/usr/local/lib/python2.7/site-packages/instabot/api/api.py", line 195, in uploadPhoto return uploadPhoto(self, photo, caption, upload_id) File "/usr/local/lib/python2.7/site-packages/instabot/api/api_photo.py", line 73, in uploadPhoto m = MultipartEncoder(data, boundary=self.uuid) File "/usr/local/lib/python2.7/site-packages/requests_toolbelt/multipart/encoder.py", line 119, in init self._prepare_parts() File "/usr/local/lib/python2.7/site-packages/requests_toolbelt/multipart/encoder.py", line 240, in _prepare_parts self.parts = [Part.from_field(f, enc) for f in self._iter_fields()] File "/usr/local/lib/python2.7/site-packages/requests_toolbelt/multipart/encoder.py", line 489, in from_field return cls(headers, body) File "/usr/local/lib/python2.7/site-packages/requests_toolbelt/multipart/encoder.py", line 482, in init self.len = len(self.headers) + total_len(self.body) TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'
I have the same problem.
I fixed it by:
1: $ pip uninstall instabot
2: $ pip install instabot==0.3.3.21
This solved the Problem. There seems to be a commit with a bug
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Using this code in my upload_photo.py file
Got this error: