Open OmarGuajardo opened 7 months ago
Happens on latest version (2.1.1) too. Adding is_paid_partnership=False solves the issue.
As this property is not set in the Story class and therefore will be undefined, I assume that pydantic is throwing this error as it expects a valid bollean type.
I have the same problem
@andimattes Hi! I have the same error in my code. How can you solve this issue? I tried "cl.photo_upload_to_story(media_path, is_paid_partnership=False)" but it also made another error. How can I solve this error "TypeError: UploadPhotoMixin.photo_upload_to_story() got an unexpected keyword argument 'is_paid_partnership'"?
To provide a simple solution for now:
Go to the Telethon library folder and find types.py at C:\Program Files\Python39\Lib\site-packages\instagrapi/. Add a comment marker # at row 324. Then, find extractors.py at C:\Program Files\Python39\Lib\site-packages\instagrapi/ and add a comment marker # at row 426. This will solve the problem. 😄
@Adhambec Wow!! Thank you so much!!
Is any other solid workaround other than this? https://github.com/subzeroid/instagrapi/issues/1851#issuecomment-2036437312
For now I just use previous tag 😢
I ended up using the official Instagram API
To provide a simple solution for now:
Go to the Telethon library folder and find types.py at C:\Program Files\Python39\Lib\site-packages\instagrapi/. Add a comment marker # at row 324. Then, find extractors.py at C:\Program Files\Python39\Lib\site-packages\instagrapi/ and add a comment marker # at row 426. This will solve the problem. 😄
Thank you, it worked. You can try this!
The Story class has this parameter defined as optional, but it does not have a default value. I requested a pull request setting False as the default value. Now we have to wait and see if it is accepted.
Fixed in instagrapi==2.1.2
, issue could be closed
Getting exception when trying to do client.photo_upload_to_story()
Describe the bug I'm using the Client to perform photo_upload_to_story in the following way
storyPosted = self.instagramClient.photo_upload_to_story(nextPhotoToPublishImagePath,extra_data = {'is_paid_partnership' : 0})
Where really I'm just passing an image path, weirdly enough the photo still uploads but then I get an exception saying
Here's the bigger picture on how I'm using the function
Personal Comments
In
instagrapi/mixins/photo.py
functionphoto_upload_to_story
, when creatingStory
if I add the fieldis_paid_partnership=False
then the issue resolves but this is weird behavior since in the class definition ofStory
we haveis_paid_partnership: Optional[bool]
so I'm not sure why we are getting this error.Desktop (please complete the following information):
Additional context Add any other context about the problem here.