Hello everyone!

Today I’ll show you how you can stream the Monstercat FM from twitch to your Raspberry Pi and enjoy 24/7 non-stop electro music! We’ll use the audio stream from twitch.tv/monstercat with the python package called ‘livestreamer’.

What you’ll need:

Raspberry Pi (obviously)

Internet connection for the Pi via Ethernet or WiFi

Speakers with 3.5mm jack

SD card with the OS installed in it (I recommend using Raspbian)

We won’t need a monitor as we’ll connect to the Raspberry via SSH, but you can also connect a keyboard and a HDMI monitor.

I’ll assume your main user is pi, so your main folder is /home/pi

First, update and upgrade:

sudo apt-get update sudo apt-get upgrade

Install some required stuff:

sudo apt-get install rtmpdump python-pip

Install livestreamer:

sudo pip install livestreamer

Now lets make the script to start streaming easily!

I’ll make it in my home folder (/home/pi) and name it monstercat.sh

You can use your favourite text editor, but if you want to use nano, type:

nano monstercat.sh

This is the script:

#!/bin/sh livestreamer twitch.tv/monstercat audio -np 'omxplayer -o local'

The arguments:

audio is the desired quality. You can also stream the video, but we’ll use only audio as it is faster

-np changes the media player which the stream is sent to. The default one is VLC, so we’ll change it.

‘omxplayer -o local’: it will use the built-in omxplayer with the argument -o local which indicates that we want the stream to be sent to the jack. You can change it for hdmi if you want to.

It should look like this:



Make it executable:

chmod +x monstercat.sh

And start the fun!

./monstercat.sh

To stop, simply press Ctrl+C

Now, we are going to make it start automatically when the Pi boots.

We’ll edit the rc.local file, which is executed during the boot and we can make it execute our monstercat.sh so we don’t need to start it manually with our computer or keyboard!

You can use your favourite text editor, but if you use nano:

sudo nano /etc/rc.local

It should look like this:

Add this like just before the exit 0:

sudo -u pi /home/pi/monstercat.sh &

Make sure to put the &. Otherwise the Pi won’t boot. It should look like this:

Then save and reboot.