A PHP script that allows for you to go live on Instagram with any streaming program that supports RTMP!
Built with mgp25's amazing Instagram Private API Wrapper for PHP. But this API is now private. So we will use the last avaliable copy on adrifkat's repository.
Tested in Windows 10. Please read this entire document as it has very important information about the script. If you create an issue that can be solved by reading this document, it will be ignored.
If you are running this after the first setup, work from step six on...
Also, if you are updating this script from an old version, please delete your old script and re-follow all these instructions.
- Install PHP. Download for Windows
- Install the lastest Composer version
- Clone the Repository
- Run
composer install
in the cloned folder - Edit the Username and Password inside of
config.php
to your Instagram details Change the second argument (USERNAME and PASSWORD) of define function. Do NOT change "IG_USERNAME" or "IG_PASS". - Run the
goLive.php
script. (php goLive.php
) - Copy you Stream-URL and Stream-Key and paste them into your streaming software.
Cpming soon.
- Set your OBS canvas size to 720x1280. This can be done by going to Settings->Video and editing Base Canvas Resolution to "720x1280".
- Go to the "Stream" section of your OBS Settings
- Set "Stream Type" to "Custom Streaming Server"
- Set the "URL" field to the stream url you got from the script
- Set the "Stream key" field to the stream key you got from the script
- Make Sure "Use Authentication" is unchecked and press "OK"
- Start Streaming in OBS
- To stop streaming, run the "stop" command in your terminal and then press "Stop Streaming" in OBS
To view comments and likes as you are streaming, you'll need a Windows machine as this script's async support only works on Windows. When you run the script on Windows, after it logs you in, it will open a second screen where you can enter commands as the first screen will output comments and likes.
Linux/Mac support is planned for a future release.
Type "help" to see the commands that you can use during the live stream.
This is mostly due to an invalid stream key: The stream key changes every time you start a new stream so it must be replaced in OBS every time.
This is due to you not running the "stop" command inside the script. You cannot just close the command window to make Instagram stop streaming, you must run the stop command in the script. If you do close the command window however, start it again and just run the stop command, this should stop Instagram from listing to live content.
This is usually due to archiving a stream that had no content (video). Just delete the archive and be go on with your day.
This is can be caused by 1 of 2 reasons:
- You did not stream anything. Please make sure you actually send a video to the stream url or the archive may fail to load.
- You did not change your stream content/canvas size. If you are using OBS, you can address this by following step one in OBS Setup Section.
This is due to CURL not having a valid CA. You can find a solution here: https://stackoverflow.com/a/34883260.
This means Instagram is refusing to connect to your proxy/computer. This could be for a wide verity of different reasons. I cannot help you when this if this happens, it's out of my control and there is nothing you can do to fix this other than changing your IP Address or actual computer you are using. Additionally, a proxy or VPN could create this issue.