subzeroid / instagrapi

🔥 The fastest and powerful Python library for Instagram Private API 2024
https://hikerapi.com/p/bkXQlaVe
MIT License
4.38k stars 686 forks source link

Instagram API photo_upload_to_story (Upload Story \w link) doesn't work [BUG] #712

Closed innicoder closed 2 years ago

innicoder commented 2 years ago

Describe the bug Posting one Instagram story is not an issue, it works perfectly with the URL being rendered correctly, however, the issue occurs if you try to post multiple stories.

For some reason, if you try to post multiple stories, in a for loop, it doesn't change the URL. It applies the same URL even though you send the actually correct (different) URL.

This is a very weird bug and I checked many times to see if the data I am providing is for some reason wrong, it is not, you send different data and it only displays the first one you send. I will include an example to produce the bug.

To Reproduce

from pathlib import Path
from instagrapi import Client
from instagrapi.types import StoryLink

cl = Client()
cl.login(USERNAME, PASSWORD)

for i in range(100):
    cl.photo_upload_to_story(Path('imgtouploadpath.jpg'), links=[StoryLink(webUri=f'https://www.{i}.com')])

Traceback No trackback, just posts it as everything is normal, after checking the results you see it is not.

Expected behavior It should post a link, that is correct with the one that is being sent.

The link you send through the function .photo_upload_to_story is only correct with the first story you upload, after that for some reason it includes the first URL.

Desktop (please complete the following information):

innicoder commented 2 years ago

Any updates? Is it possible to upload multiple stories? Does the story with the link work properly? I couldn't get it to work.

Note I tried buying your service yet it didn't work on there either..

adw0rd commented 2 years ago

@innicoder fixed