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