Skip to content

Commit

Permalink
Merge pull request #2081 from gub-7/feature_go_live
Browse files Browse the repository at this point in the history
Feature: Initiate and start livestreams for the logged in user
  • Loading branch information
subzeroid authored Dec 9, 2024
2 parents 4e3efc7 + 85ffd8e commit 9ef3207
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions instagrapi/mixins/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -1154,6 +1154,24 @@ def media_unpin(self, media_pk):
"""
return self.media_pin(media_pk, True)


def media_schedule_livestream(self, title, auto_start=False):
data = {
"broadcast_message": title,
"internal_only": "false",
"source_type": "203",
"visibility": "0"
}
result = self.private_request("live/create/", data)
broadcast_id = result['broadcast_id']
if auto_start:
startRes = self.media_start_livestream(broadcast_id)
return result

def media_start_livestream(self, broadcast_id):
result = self.private_request(f"live/{broadcast_id}/start/", {'empty': None})
return result["status"] == "ok"

def media_fetch_live_chat(self, broadcast_id, last_comment_ts=None):
params = None
if last_comment_ts:
Expand Down

0 comments on commit 9ef3207

Please sign in to comment.