Pyradio – 從 Linux 終端播放您最喜歡的廣播電台

Pyradio 是一個基於 Python 的免費開源命令行工具,可讓您在線播放您喜愛的廣播電台。 我們將帶您完成 Pyradio 的安裝以及如何從 Ubuntu Linux 終端在線播放您喜歡的廣播電台。 我們已經在 Ubuntu 18.04 版本上測試了這個安裝。

安裝 Pyradio 之前的先決條件

在我們開始之前,這裡有一些我們需要在 Linux 系統中安裝的東西。

  1. 蟒蛇3
  2. pip3
  3. mplayer 或 vlc 媒體播放器

安裝 PyRadio

要安裝 PyRadio,請克隆 git 存儲庫

https://github.com/coderholic/pyradio.git

克隆成功後,導航到pyradio文件夾

cd pyradio

接下來,我們將通過從源代碼構建來安裝 Pyradio

從源代碼構建 Pyradio

python setup.py build

接下來,安裝構建

python setup.py install

安裝成功後,就可以啟動 Pyradio 並收聽您喜歡的廣播電台了!

要啟動 Pyradio,您需要從 root 切換到普通用戶並運行

pyradio --play

輸出

滾動到您喜歡的電台並點擊 Enter 開始流式傳輸。

要查看,電台列表文件前往

pyradio/pyradio

在此目錄中,您將找到如圖所示的stations.csv 文件

vim stations.csv

輸出

  1 # Find lots more stations at https://www.iheart.com,
  2 Alternative (BAGeL Radio - SomaFM),https://somafm.com/bagel.pls
  3 Alternative (The Alternative Project),https://c9.prod.playlists.ihrhls.com/4447/playlist.m3u8
  4 American Roots (Boot Liquor - SomaFM),https://somafm.com/bootliquor.pls
  5 Celtic (ThistleRadio - SomaFM),https://somafm.com/thistle.pls
  6 Chillout (Groove Salad - SomaFM),https://somafm.com/startstream=groovesalad.pls
  7 Commodore 64 Remixes (Slay Radio),https://www.slayradio.org/tune_in.php/128kbps/listen.m3u
  8 Covers (SomaFM),https://somafm.com/covers.pls
  9 Downtempo (Secret Agent - SomaFM),https://somafm.com/secretagent.pls
 10 Dub Step (Dub Step Beyond - SomaFM),https://somafm.com/dubstep.pls
 11 Electronic/Dance (Electronic Culture),https://www.shouted.fm/tunein/electro-dsl.m3u
 12 Folk (Folk Forward - SomaFM),https://somafm.com/folkfwd.pls
 13 Hip Hop (Hot 97 NYC),https://playerservices.streamtheworld.com/pls/WQHTAAC.pls
 14 Hip Hop (Power 1051 NYC),https://c11.prod.playlists.ihrhls.com/1481/playlist.m3u8
 15 House (Beat Blender - SomaFM),https://somafm.com/startstream=beatblender.pls
 16 Indie Pop (Indie Pop Rocks! - SomaFM),https://somafm.com/indiepop130.pls
 17 Intelligent dance music (Cliq Hop - SomaFM),https://somafm.com/startstream=cliqhop.pls
 18 Jazz (Sonic Universe - SomaFM),https://somafm.com/startstream=sonicuniverse.pls
 19 Lounge (Illinois Street Lounge - SomaFM),https://somafm.com/illstreet.pls
 20 Pop (PopTron! - SomaFM),https://somafm.com/poptron.pls
 21 Pop/Rock/Urban  (Frequence 3 - Paris) ,https://streams.frequence3.net/hd-mp3.m3u
 22 Progressive (Tags Trance Trip - SomaFM),https://somafm.com/tagstrance.pls
 23 Public Radio (WNYC - Public Radio from New York to the World),https://wnyc-iheart.streamguys.com/wnycfm-iheart.aac
 24 Reggae Dancehall (Ragga Kings),https://www.raggakings.net/listen.m3u
 25 Rock (Digitalis - SomaFM),https://somafm.com/digitalis.pls
~                                                                                                                                      
~

訪問幫助手冊頁運行

pyradio -h

樣本輸出

usage: pyradio [-h] [--stations STATIONS] [--play [PLAY]] [--add] [--list]

Console radio player

optional arguments:
  -h, --help            show this help message and exit
  --stations STATIONS, -s STATIONS
                        Path on stations csv file.
  --play [PLAY], -p [PLAY]
                        Start and play. The value is num station or empty for
                        random.
  --add, -a             Add station to list.
  --list, -l            List of added stations.

其他有用的控件

Enter - Play the highlighted station
- / +    - Increase / Decrease the volume
    m    - Mute
    r      - Select a random station
    q     -  Quit / End

另請閱讀:

  • Tlog – 記錄/播放終端 IO 和會話的工具
  • 如何在終端上顯示隨機 ASCII 藝術
  • Tizonia – Linux 的命令行音樂播放器
  • MPS-Youtube – 在 Linux 命令行上播放和下載 Youtube 視頻

在本文中,我們概述瞭如何安裝和使用 Pyradio 來播放您喜歡的廣播電台。 Pyradio 是一個方便的命令行工具,您可以使用它來消除無聊並通過收聽無數的全球廣播電台來注入一些興奮。 它可以安裝在許多基於 Debian 和 RedHat 的 Linux 發行版上。 你也可以試試其他版本 github 上的 Pyradio 但我們沒有測試它。 試一試,給我們您的反饋。 🙂

資源參考

GitHub – 比拉迪奧