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

Error in input requirements for photo_upload_to_story [BUG] #1755

Open
JayTongue opened this issue Jan 19, 2024 · 0 comments
Open

Error in input requirements for photo_upload_to_story [BUG] #1755

JayTongue opened this issue Jan 19, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@JayTongue
Copy link

My current code is:

album = ['temp/temp_0_0.jpg', 'temp/temp_0_1.jpg', 'temp/temp_0_2.jpg']
for story in album:
        story = Path(story)
        bot.photo_upload_to_story(path=story, caption='')

And I get:

Traceback (most recent call last):
  File "D:\Python Projects\Post Scheduler\with_instagrapi.py", line 111, in <module>
    main()
  File "D:\Python Projects\Post Scheduler\with_instagrapi.py", line 17, in main
    run_bot(post)
  File "D:\Python Projects\Post Scheduler\with_instagrapi.py", line 73, in run_bot
    bot.photo_upload_to_story(path=story, caption='')
  File "C:\Users\_____\AppData\Local\miniconda3\Lib\site-packages\instagrapi\mixins\photo.py", line 394, in photo_upload_to_story
    return Story(
           ^^^^^^
  File "C:\Users\jct3368\AppData\Local\miniconda3\Lib\site-packages\pydantic\main.py", line 164, in __init__
    __pydantic_self__.__pydantic_validator__.validate_python(data, self_instance=__pydantic_self__)
pydantic_core._pydantic_core.ValidationError: 1 validation error for Story
pk
  Input should be a valid string [type=string_type, input_value=3284033950949101872, input_type=int]
    For further information visit https://errors.pydantic.dev/2.5/v/string_type

I've tried to get both using Path() and str(), but neither works to satisfy the input datatype error.

@JayTongue JayTongue added the bug Something isn't working label Jan 19, 2024
@JayTongue JayTongue changed the title [BUG] Error in input requirements for photo_upload_to_story [BUG] Jan 19, 2024
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

1 participant