cmc/cleberg.net
My personal web garden & blog.
clone: git clone https://gitbay.org/cmc/cleberg.net.git
main: content/blog/2022-07-25-curseradio.org · raw
1#+date: [2022-07-25 Mon 00:00:00]
2#+title: Curseradio: Internet Radio from the Terminal
3#+description: Installing and using Curseradio to stream internet radio from the terminal.
4#+slug: curseradio
5#+filetags: :linux:
6
7* Overview
8
9While exploring some interesting Linux applications, I stumbled across
10[[https://github.com/chronitis/curseradio][curseradio]], a command-line radio player based on Python.
11
12This application is fantastic and incredibly easy to install, so I wanted to
13dedicate a post today to this app. Let's look at the features within the app and
14then walk through the installation process I took to get =curseradio= working.
15
16* Features
17
18The radio player itself is quite minimal. As you can see in the screenshot
19above, it contains a simple plaintext list of all available categories, which
20can be broken down further and further. In addition, radio shows are available
21for listening, alongside regular radio stations.
22
23For example, the =Sports= > =Pro Basketball= > =Shows= category contains a
24number of specific shows related to Professional Basketball.
25
26Aside from being able to play any of the listed stations/shows, you can make a
27channel your favorite by pressing =f=. It will now show up at the top of the
28radio player in the =Favourites= category.
29
30** Commands/Shortcuts
31
32| Key(s) | Command |
33|------------+---------------------------------|
34| ↑, ↓ | navigate |
35| PgUp, PgDn | navigate quickly |
36| Home, End | to top/bottom |
37| Enter | open/close folders, play stream |
38| k | stop playing stream |
39| q | quit |
40| f | toggle favourite |
41
42* Installation
43
44** Dependencies
45
46Before installing =curseradio=, a handful of system and Python packages are
47required. To get started, install =python3=, =pip3=, and =mpv= on your system.
48In this example, I'm using Fedora Linux, which uses the =dnf= package manager.
49You may need to adjust this if you're using a different system.
50
51#+begin_src sh
52sudo dnf install python3 pip3 mpv
53#+end_src
54
55Next, use =pip3= to install =requests=, =xdg=, and =lxml=:
56
57#+begin_src sh
58pip3 install requests xdg lxml
59#+end_src
60
61** Repository Source Installation
62
63Once all the dependencies are installed, we can clone the source code and enter
64that directory:
65
66#+begin_src sh
67git clone https://github.com/chronitis/curseradio && cd curseradio
68#+end_src
69
70Once you're within the =curseradio= directory, you can install the application
71with the provided =setup.py= script.
72
73#+begin_src sh
74sudo python3 setup.py install
75#+end_src
76
77In my case, I ran into a few errors and needed to create the folders that
78curseradio wanted to use for its installation. If you don't get any errors, you
79can skip this and run the app.
80
81#+begin_src sh
82sudo mkdir /usr/local/lib/python3.10/
83sudo mkdir /usr/local/lib/python3.10/site-packages/
84#+end_src
85
86#+begin_src sh
87sudo chown -R $USER:$USER /usr/local/lib/python3.10/
88#+end_src
89
90* Run the Application
91
92Once fully installed without errors, you can run the application!
93
94#+begin_src sh
95python3 /usr/local/bin/curseradio
96#+end_src