All projects

Live Stream Configurator

A way to programmatically configure a Facebook Live Stream.

Technologies
Python

Background

As the 2020 pandemic shook the world and my musician father could no longer perform live, he decided to take to the virtual stage. He began performing and broadcasting concerts through the Facebook Live platform, which brought with it a unique set of challenges.

The process of starting a live stream through Facebook’s web portal and configuring the streaming software on the computer turned out to be a bit cumbersome and frustrating at times. Through the web portal, you generate a stream key, which you then enter into the settings of your streaming software to start the broadcast. Many times, however, the web page would not load or became unresponsive, which would derail the whole endeavor.

I knew there had to be a more efficient and reliable way to achieve this task and after a little bit of research, I familiarized myself with Facebook’s API and created an applet to programmatically generate and retrieve a stream key.

How it Works

The program works by sending a POST request to the Facebook Live Video API, passing along parameters such as title and description for the live stream. A JSON object is returned, which includes the secure stream URL.

In the case of configuring OBS for Facebook streaming, the Facebook Live URL is predefined and only the stream key must be entered. This program parses the stream key from the JSON data and copies it to the clipboard so it can be easily pasted into your streaming software.

For more information on the Facebook Live API, visit: developers.facebook.com

For more information on OBS, visit: obsproject.com

View the code on GitHub

View source code