Bashscript-based radio station player
usage: radio stationname
example: radio kexp
Or use the unique ID of every station: radio ID
To get the ID for example search for a tag.
To play a random station: radio random
If you want to exclude stations with word in their name from random:
radio random -X word
-a --add
add a station to local database. If called without any other parameter an interactive dialog guides you through the process of adding a station
For not using the interactive version provide the following parameters (in this exact order):
name (must not be empty)
Stream URL (must not be empty)
Backup-Stream URL
Location of the station
Tags
To prevent any issues with special characters I strongly recommend to quote every parameter (see example)
To leave a parameter empty just use ""
example: radio -a "Radio Station 2000" "http://streamingurl:8000" "" "San Francisco, USA" "club, dance, techno"
in this example the value for the Backup-Stream URL is left empty
-b --backup
play backup stream (if exists). Might help if the primary streaming URL is not working
-d --dump
dump radop stream instead of playing. pass id or word as usual + duration of dump.
example: radio -d 25 30
dumps the stream of the station with id 25 for 30 minutes
the dump can be found at ./stream.dump
-h --help
displays this help menu
-l --list
search radiostations for specific word. This doesn't search for a stationname but for a tag.
example: radio -l ambient
use radio -l search random
to randomly play a station that matches the search
example: radio -l ambient random
-la --list-all
list all station Names (Caution: There might be a lot!)
-lr --list-regions
list all regions for radio stations
-mp --most-played
lists the top 10 most played radio stations measured by duration of playing (most played first)
-p --print
prints the URL of a station. Can be used with names or IDs
example: radio -p 5
to print the backup stream use radio -p -b
-r --region
list all radio stations for specific region
example: radio -r beirut
use radio -r search random
to randomly play a station for that region
example: radio -r seattle random
-rp --recently-played
list 10 last played stations (newest first)
-u --update
updates the script itself. Caution: Every changes you might have done to the script yourself will be lost!
-x
use proxy for playing streams. Pass proxy in following format http_proxy://url:port
example: radio -x http_proxy://proxy:8080 random
please check 'requirements' before running any command
git clone https://github.com/todestoast/radio
cd radio
chmod +x installer.sh
./installer.sh
- checkout the code of this repository
- create ~/.radio
- copy radio.db and db.md5 to this directory
- compile sqlite3 cli tool to this directory (see https://sqlite.org/howtocompile.html)
- copy radio to /usr/local/bin
- git
- gcc
- unzip
- wget
- mplayer
- sqlite3 (if you install the software with the installer script sqlite is already installed)
- mpv (currently used for playing aac streams - I am happy for any solution on how to get it working with mplayer)
run url_checker.sh it will print out any URL with HTTP response 404