jarrodnorwell / InstaPy2

Instagram automation tool for farming comments, follows and likes, written in Python
GNU General Public License v3.0
52 stars 9 forks source link

Upload photo. I get 302 error #20

Closed VFansss closed 12 months ago

VFansss commented 1 year ago

Hi!

I'm trying to find a library that allow to upload photo to Insta. This seems to be the most uptodate.

I've studied examples and how the code is made. Here my code (off course username & password are different):

# coding=utf-8
from instapy2 import InstaPy2
from instapy2.types import PostType

session = InstaPy2()
session.login(username='MYUSERNAME', password='MYPASSWORD')

session.post(path="generated-image.png", caption="Test", type=PostType.Path)

Seems that I correctly login, but then I got this exception:

 File "C:\Users\aledi\AppData\Local\Programs\Python\Python311\Lib\site-packages\instagrapi\mixins\photo.py", line 192, in photo_rupload
    raise PhotoNotUpload(response.text, response=response, **last_json)
instagrapi.exceptions.PhotoNotUpload: Unknown ({'message': '', 'response': <Response [302]>})

Is something expected somehow, or I'm missing something?

Thanks for reading

jarrodnorwell commented 1 year ago

I'll take a look into that in a few days, I've been fairly busy with other projects and haven't felt too compelled to work on Python stuff for a while. It's possibly an auth issue but I'll know more later.