dilame / instagram-private-api

NodeJS Instagram private API SDK. Written in TypeScript.
MIT License
5.99k stars 1.14k forks source link

Set Profile Picture #1244

Open SmartDev8 opened 4 years ago

SmartDev8 commented 4 years ago

Now I am trying to change my profile picture, But when I upload profile picture using UploadRepository it returns 404 error. URL format is /rupload_igphoto/${name} so full url is https://i.instagram.com/api/v1/rupload_igphoto/${name} and name is 15966481210520-7086334228. Can anyone please let me know what is wrong? Thanks.

Nerixyz commented 4 years ago

You don't need to access the raw UploadRepository to change the profile picture. There's ig.media.changeProfilePicture().

I'd guess the - sign in the random part is causing issues.

SmartDev8 commented 4 years ago

Hi Nerixyz! Thanks for your comment. https://github.com/dilame/instagram-private-api/issues/960 This is the issue about the change profile picture. So I followed your answer on above issue. I attached the two screenshot , one is AccountRepository changeProfilePicture function, another is UploadRepository upload photo function. account upload

Please check the screenshot and help me . And I checked the MediaRepository , but there is no changeProfilePicture function. Now I am building android source code to change profile picture function, so I can not use type script directly. I should make the request on android source like AccountRepository, and UploadRepository. Thanks.

Nerixyz commented 4 years ago

Seems like you're on an older branch. But changing the profile picture is essentially uploading a photo, with some upload id and then sending this id in the change_profile_picture request. Remember to stringify the right parameters in ruploadParams.

SmartDev8 commented 4 years ago

Thanks for you reply again. https://github.com/Nerixyz/instagram-private-api/ Now I am on this github's master branch. and I sent the ruploadparams as json string. I tried to upload photo first and the upload API returns 404 error. Now are you sure the upload API is working well? I appriciate you. Thanks.