Describe the bug
A clear and concise description of what the bug is.
Trying to tag users within Client.photo_upload results in InvalidTag errors.
To Reproduce
Provide a piece of code to reproduce the problem.
from instagrapi import Client
from instagrapi.types import Usertag, UserShort
import random
client = Client()
client.login("usr", "pswd")
lidl = Usertag(x=10, y=10, user=UserShort(username="lidlus", pk="5310318684"))
peru = Usertag(x=20, y=20, user=UserShort(username="avosfromperu", pk="1382501091"))
tags = [lidl, peru]
client.photo_upload("path", "caption", usertags=tags)
Traceback
Show your full traceback so that it is clear where exactly the error occurred.
Traceback (most recent call last):
File "/Users/kaiji/PycharmProjects/avotesla/lib/python3.8/site-packages/instagrapi/mixins/private.py", line 298, in _send_private_request
response.raise_for_status()
File "/Users/kaiji/PycharmProjects/avotesla/lib/python3.8/site-packages/requests/models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://i.instagram.com/api/v1/media/configure/
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/kaiji/PycharmProjects/avotesla/main.py", line 16, in <module>
client.photo_upload(f"/Users/kaiji/PycharmProjects/avotesla/avocados/p{i}.jpeg", "Another delicious whole avocado... \r\n\r\n\r\n#LidlAvoTeslaSweepstakes @lidlus @avosfromperu", usertags=tags)
File "/Users/kaiji/PycharmProjects/avotesla/lib/python3.8/site-packages/instagrapi/mixins/photo.py", line 234, in photo_upload
if self.photo_configure(
File "/Users/kaiji/PycharmProjects/avotesla/lib/python3.8/site-packages/instagrapi/mixins/photo.py", line 310, in photo_configure
return self.private_request("media/configure/", self.with_default_data(data))
File "/Users/kaiji/PycharmProjects/avotesla/lib/python3.8/site-packages/instagrapi/mixins/private.py", line 446, in private_request
raise e
File "/Users/kaiji/PycharmProjects/avotesla/lib/python3.8/site-packages/instagrapi/mixins/private.py", line 433, in private_request
self._send_private_request(endpoint, **kwargs)
File "/Users/kaiji/PycharmProjects/avotesla/lib/python3.8/site-packages/instagrapi/mixins/private.py", line 355, in _send_private_request
raise UnknownError(**last_json)
instagrapi.exceptions.UnknownError: Invalid Tagged Users in this media
Expected behavior
A clear and concise description of what you expected to happen.
I expected for the post to succeed.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
OS: [e.g. Ubuntu 21.04] MacOS Monterey
Python version [e.g. 3.8.3] 3.8.5
instagrapi version [e.g. 1.9.3, not "latest"] 1.16.20
moveipy version if used
imagemagick version if used
Additional context
Add any other context about the problem here.
Describe the bug A clear and concise description of what the bug is. Trying to tag users within Client.photo_upload results in InvalidTag errors. To Reproduce Provide a piece of code to reproduce the problem.
Traceback Show your full traceback so that it is clear where exactly the error occurred.
Expected behavior A clear and concise description of what you expected to happen. I expected for the post to succeed. Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context Add any other context about the problem here.