Created
September 6, 2017 20:57
-
-
Save marcsello/57f54c4854541aa0a8b801cfc36ee3aa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| echo -e "Fetching station list...\n" | |
| list=$(curl "--station_lising--" 2>/dev/null) | |
| streaming_links=() | |
| link_cnt="0" | |
| while read -r i; do | |
| # decode the entry | |
| name=$(echo "$i" | cut -d ';' -f 1) | |
| link=$(echo "$i" | cut -d ';' -f 2) | |
| # do magic | |
| streaming_links+=("$link") | |
| # print option | |
| echo "$link_cnt) $name" | |
| link_cnt=$(($link_cnt + 1)) | |
| done <<< "$list" | |
| echo -e "q) quit\n" | |
| echo "It's time to choose Dr. Freeman" | |
| read choosen_idx | |
| [ "$choosen_idx" == "q" ] && exit 0 | |
| if [[ ! "$choosen_idx" =~ ^[0-9]+$ ]]; then | |
| echo "de number pls" | |
| exit 1 | |
| fi | |
| if [ "$choosen_idx" -gt "$link_cnt" ]; then | |
| echo "de jo number pls" | |
| exit 1 | |
| fi | |
| mplayer ${streaming_links[$choosen_idx]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment