Skip to content

Instantly share code, notes, and snippets.

@Barteks2x
Last active March 6, 2016 03:39
Show Gist options
  • Save Barteks2x/d70e96d7b0e6be91ba89 to your computer and use it in GitHub Desktop.
Save Barteks2x/d70e96d7b0e6be91ba89 to your computer and use it in GitHub Desktop.
A simple linux "play and record" online radio command that uses mplayer. You may want to create "radio" (sh) with this: screen -A -m -d -S "radio" "radiocmd" so that it starts that in a screen session. In this example it plays radiozet.
#!/bin/bash
mkdir ~/radio || true
#change to other online radio?
RADIO_NAME=radiozet
NAME=~/radio/$RADIO_NAME-$(date).mp3
LINK_TO_RADIO=http://radiozetmp3-07.eurozet.pl:8400/
mplayer $LINK_TO_RADIO -dumpstream -dumpfile "$NAME" -vc dummy -vo null &
sleep 2
mplayer -vo null "$NAME"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment