Fixed photo upload when posting tweets

This commit is contained in:
Manuel Cortez 2016-03-29 16:09:44 -06:00
parent ed95270d3b
commit c4e2c3b57a

View File

@ -143,9 +143,16 @@ class bufferController(object):
if tweet.image == None:
call_threaded(self.session.api_call, call_name="update_status", status=text)
else:
call_threaded(self.session.api_call, call_name="update_status_with_media", status=text, media=tweet.image)
call_threaded(self.post_with_media, text=text, image=tweet.image)
if hasattr(tweet.message, "destroy"): tweet.message.destroy()
def post_with_media(self, text="", image=None, description=None):
if image != None:
img = self.session.twitter.twitter.upload_media(media=image)
# if description != None:
# self.session.twitter.twitter.set_description(media_id=img["media_id"], alt_text=description)
self.session.api_call(call_name="update_status", status=text, media_ids=img["media_id"])
def save_positions(self):
try:
self.session.db[self.name+"_pos"]=self.buffer.list.get_selected()