Ecouter la radio en mode console, adaptation d’un script bash
Posted by drill
1 comments

Une citation pour Antoine,
Utiliser des logiciels propriétaires, c’est comme les plats préparés, on est incapable de dire les conservateurs qu’ils contiennent, on dira toujours que c’est bon, mais ça ne remplacera jamais le repas fait maison par sa maman.
Alors j’ai trouvé puis adpaté un script bash pour pouvoir écouter la radio avec son terminal
#!/bin/bash ######################################################## # Drill_radio                                         # # based on IceFox radio-select script                 # # Hack by Drill           # ######################################################## # set colors RED='\e[41m' BLUE='\e[44m' CYAN='\e[46m' NC='\e[0m' # set player PLAYER="/usr/bin/mplayer" # verifit si $PLAYER est installe if [ -e $PLAYER ]; then    # stop current $PLAYER session    if [ "$(pidof mplayer)" ]; then        killall mplayer    fi    while true; do    clear    echo ""    echo " ·····················································"    echo " ·            Choisit une station et écoute        ·"    echo -e " ·                    Radio $RED Drill $NC                ·"    echo -e " · $CYAN[space]$NC pause, $CYAN[q]$NC stop, $CYAN[Ctrl]+1$NC pour quitter ·"    echo " ·····················································"    echo ""    echo " ·····················································"    echo -e " · $BLUE 1 $NC Chérie FM           $BLUE 2 $NC Demoiselle Fm  ·"    echo -e " · $BLUE 3 $NC FG Underground      $BLUE 4 $NC France Culture H·"    echo -e " · $BLUE 5 $NC Fun Radio France    $BLUE 6 $NC NRJ            ·"    echo -e " · $BLUE 7 $NC Ouï FM              $BLUE 8 $NC Radio Junior   ·"    echo -e " · $BLUE 9 $NC Skyrock             $BLUE 10 $NC Chante France  ·"    echo -e " · $BLUE 11 $NC MFM                 $BLUE 12 $NC Bide et Musique ·"    echo -e " · $BLUE 13 $NC La Grosse Radio     $BLUE 14 $NC Fréquence 3    ·"    echo -e " · $BLUE 15 $NC Radio Classique     $BLUE 16 $NC France Info    ·"    echo -e " · $BLUE 17 $NC 100% Radio          $BLUE 18 $NC FBleu Basse Norm·"    echo -e " · $BLUE 19 $NC FIP                 $BLUE 20 $NC >>>            ·"    echo " ·············································PAGE 1/2"    echo -e " $CYAN[/]$NC diminuer, $CYAN[*]$NC augmenter, $CYAN[m]$NC pour couper le son "    echo ""    echo -e " tape un $BLUE nombre $NC entre 1 et 20 et tape $CYAN[Entrée]$NC"    echo ""    read choix    case $choix in    1)       $PLAYER http://95.81.146.10/5009/nrj_121835.mp3       ;;    2)       $PLAYER http://213.186.61.62:8800/listen.pls       ;;    3)       $PLAYER http://radiofg.impek.com/ufg       ;;    4)       $PLAYER http://viphttp.yacast.net/V4/radiofrance/franceculture_hd.m3u       ;;    5)       $PLAYER http://streaming.radio.funradio.fr:80/fun-1-44-128       ;;    6)       $PLAYER http://adwzg3.tdf-cdn.com/8470/nrj_165631.mp3       ;;    7)       $PLAYER http://ouifm.ice.infomaniak.ch/ouifm-high.mp3       ;;    8)       $PLAYER http://213.186.61.62:8080/       ;;    9)       $PLAYER http://player.skyrock.fr/V4/skyrock/skyrock.m3u       ;;    10)       $PLAYER http://stream1.chantefrance.com/Chante_France.m3u       ;;    11)       $PLAYER http://players.creacast.com/creacast/mfm/playlist.m3u       ;;    12)       $PLAYER http://www.bide-et-musique.com/playlist-hq.m3u       ;;    13)       $PLAYER http://hd.lagrosseradio.info:8500/listen.pls       ;;    14)       $PLAYER http://streams.frequence3.net/hd-mp3.m3u       ;;    15)       $PLAYER http://players.creacast.com/creacast/classique/playlist.pls       ;;    16)       $PLAYER http://str2.creacast.com/france_info_64       ;;    17)       $PLAYER http://mp3.live.tv-radio.com/centpourcent/all/centpourcent-128k.mp3       ;;    18)       $PLAYER http://mp3.live.tv-radio.com/fbbassenormandie/all/fbbassenormandie.mp3       ;;        19)            $PLAYER http://www.tv-radio.com/station/fip_mp3/fip_mp3-128k.m3u            ;;        20)    # Ajout de 20 autres radios    # Hack by Drill       clear       echo ""       echo " ·····················································"       echo " ·            Choisit une station et écoute        ·"      echo -e " ·                    Radio $RED Drill $NC                ·"       echo -e " · $CYAN[space]$NC pause, $CYAN[q]$NC stop, $CYAN[Ctrl]+1$NC pour quitter ·"       echo " ·····················································"       echo ""       echo " ·····················································"       echo -e " · $BLUE 1 $NC <<<                 $BLUE 2 $NC Addict Lounge  ·"       echo -e " · $BLUE 3 $NC Addict Rock         $BLUE 4 $NC Addict Star    ·"       echo -e " · $BLUE 5 $NC Best-Hits           $BLUE 6 $NC Best-Dance     ·"       echo -e " · $BLUE 7 $NC BFM                 $BLUE 8 $NC Contact FM     ·"       echo -e " · $BLUE 9 $NC FG DJ Radio         $BLUE 10 $NC FG Underground ·"       echo -e " · $BLUE 11 $NC FG Vintage          $BLUE 12 $NC Fréquence Jazz ·"       echo -e " · $BLUE 13 $NC Fun Radio           $BLUE 14 $NC NRJ            ·"       echo -e " · $BLUE 15 $NC Radio Gerard        $BLUE 16 $NC Radio Nova     ·"       echo -e " · $BLUE 17 $NC RTL                 $BLUE 18 $NC RTL2           ·"       echo -e " · $BLUE 19 $NC Suitz               $BLUE 20 $NC Autre radio    ·"       echo " ·············································PAGE 2/2"       echo -e " $CYAN[/]$NC diminuer, $CYAN[*]$NC augmenter, $CYAN[m]$NC pour couper le son "       echo ""       echo -e " tape un $BLUE nombre $NC entre 1 et 20 et tape $CYAN[Entrée]$NC"       echo ""       read choix2       case $choix2 in       1)          bash ./$0 # un script s'appelant lui-même          ;;       2)          $PLAYER http://stream1.addictradio.net/addictlounge.mp3          ;;       3)          $PLAYER http://stream1.addictradio.net/addictrock.mp3          ;;       4)          $PLAYER http://stream1.addictradio.net/addictstar.mp3          ;;       5)          $PLAYER http://sv1.vestaradio.com:9500          ;;       6)          $PLAYER http://sv1.vestaradio.com:7420          ;;       7)          $PLAYER http://vipicecast.yacast.net/bfm          ;;       8)          $PLAYER http://broadcast.infomaniak.ch/radio-contact-high.mp3          ;;       9)          $PLAYER http://fg.impek.tv/listen.pls          ;;       10)          $PLAYER http://ufg.impek.tv/listen.pls          ;;       11)          $PLAYER http://fgv.impek.tv/listen.pls          ;;       12)          $PLAYER http://broadcast.infomaniak.ch/frequencejazz-high.mp3          ;;       13)          $PLAYER http://streaming.radio.funradio.fr:80/fun-1-44-128          ;;       14)          $PLAYER http://mp3.live.tv-radio.com/nrj/all/nrj_113225.mp3          ;;       15)          $PLAYER http://www.mistercouzin.net:8000/listen.pls          ;;       16)          $PLAYER http://broadcast.infomaniak.net/radionova-high.mp3          ;;       17)          $PLAYER http://streaming.radio.rtl.fr/rtl-1-44-96          ;;       18)          $PLAYER http://streaming.radio.rtl2.fr:80/rtl2-1-44-96          ;;       19)          $PLAYER http://stream1.addictradio.net/addictalternative.mp3          ;;       20)          echo ""          echo "Tape ton lien ici"          echo ""          read customlink          $PLAYER $customlink          ;;       *)          echo -e "$RED Mauvais choix $NC"          echo "Essaye encore ;-)"          echo ""          sleep 2          clear          ;;       esac            ;;        *)            echo -e "$RED Mauvais choix $NC"            echo "Essaye encore ;-)"            echo ""            sleep 2            clear            ;;    esac    done else    echo " Ce script a besoin de mplayer"    echo " install le ou change de PLAYER"    echo " Tape dans ton terminal"    echo " sudo apt-get install mplayer"    echo "Fermeture ..."    exit 0 fi
copier le code dans un fichier et l’enregistrer nom_du_fichier.sh et l’executer dans un shell
executer dans le shell : bash nom_du_fichier.sh
Filed in informatique, Ubuntu
1 comments
Previous Post
« Un fond d’écran animé pour Ubuntu (LiveWallpaper) Next Post
Manipulation d’images avec ImageMagick »
« Un fond d’écran animé pour Ubuntu (LiveWallpaper) Next Post
Manipulation d’images avec ImageMagick »
15 h 47 min
essaye de rajouter un de ces liens
http://www.radioparadise.com/rp_2.php?#name=Listen