Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Getting 'Unprocessable Entity' #38

Open
FranciscoDadone opened this issue Apr 8, 2022 · 0 comments
Open

[BUG] Getting 'Unprocessable Entity' #38

FranciscoDadone opened this issue Apr 8, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@FranciscoDadone
Copy link
Contributor

Describe the bug
I get Unprocessable Entity when passing usertags to upload a clip. (From NodeJS)

To Reproduce

const FormData = require('form-data');

const formData = new FormData();
formData.append('sessionid', sessionid);
  formData.append('caption', caption);
  formData.append('url', url);
  formData.append(
    'usertags',
    `{"user": {"pk": "${userInfo.pk}", "username": "${userInfo.username}", "full_name": "${userInfo.full_name}", "profile_pic_url": "${userInfo.profile_pic_url}", "profile_pic_url_hd": "${userInfo.profile_pic_url_hd}", "stories": []}, "x": 0, "y": 0}`
  );

fetch(`${process.env.INSTAGRAPI_URL}/clip/upload/by_url`, {
    method: 'POST',
    headers: formData.getHeaders(),
    body: formData,
  })

Traceback
rcplanesglobalbot-webversion-instagrapi-1 | INFO: 172.23.0.3:44116 - "POST /clip/upload/by_url HTTP/1.1" 422 Unprocessable Entity

Expected behavior
Upload the clip with the user tagged in it.

Desktop (please complete the following information):

  • OS: Fedora 34
  • Python version 3.8-slim
  • instagrapi version 1.0.0 (as localhost:8000 says)

Additional context
If I remove

 formData.append(
    'usertags',
    `{"user": {"pk": "${userInfo.pk}", "username": "${userInfo.username}", "full_name": "${userInfo.full_name}", "profile_pic_url": "${userInfo.profile_pic_url}", "profile_pic_url_hd": "${userInfo.profile_pic_url_hd}", "stories": []}, "x": 0, "y": 0}`
  );

the clip uploads correctly but when I add the 'usertags' it gives me that error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants