Форум сайта python.su
Использую следующую функцию для загрузки аватара:
def uploadphoto(c,photo): files = {'profile_pic': (photo, open('avatars/'+photo, 'rb'), 'image/jpeg')} return requests.post('https://www.instagram.com/accounts/web_change_profile_picture/', headers={'referer': 'https://www.instagram.com/', 'origin': 'https://www.instagram.com/', 'x-csrftoken': c.cookies['csrftoken'], 'x-instagram-ajax': '1', 'x-requested-with': 'XMLHttpRequest'}, cookies=c.cookies, files=files)
Офлайн