diff --git a/instagrapi/mixins/media.py b/instagrapi/mixins/media.py index 8095eaf0..13a0f12b 100644 --- a/instagrapi/mixins/media.py +++ b/instagrapi/mixins/media.py @@ -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: