subzeroid / instagrapi

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

[BUG] Links get carried over to following stories #608

Closed just-claudio closed 1 year ago

just-claudio commented 2 years ago

Describe the bug Once a story is published with a link, the same link is then repeated on the following stories, even if no StoryLink is given to the video_upload_to_story method.

To Reproduce

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

client = Client()
client.login("user", "password")

path = Path("picture.jpg")
link = StoryLink(webUri="http://website.com")

story = StoryBuilder(path).photo(5)

client.video_upload_to_story(story.path, links=[link]) 

client.video_upload_to_story(story.path)  # This story still gets published with the same link

Desktop (please complete the following information):

Additional context Looking at the debug information I found out that the link sticker that is stored in stickers is then carried over in the video_upload_to_story method even if no stickers list is passed as argument. To confirm this, the workaround I'm currently using is to force stickers to be empty when calling the method, like so:

client.video_upload_to_story(story.path, stickers=[])

yanmcs commented 2 years ago

I'm hosting an API using Flask on Heroku and I'm facing the same problem