Skip to content

Commit

Permalink
Added feature that let's users start a live-broadcast and get the str…
Browse files Browse the repository at this point in the history
…eam_{url, key}
  • Loading branch information
gub-7 committed Dec 1, 2024
1 parent 0219f3c commit fe5648e
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 @@ -1153,3 +1153,21 @@ def media_unpin(self, media_pk):
A boolean value
"""
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)
print(startRes)
return result

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

0 comments on commit fe5648e

Please sign in to comment.