Tizonia

CLI for your favorite music service Posted by Jacek Styrylski on August 15, 2019

Description

If you are command line fan like me, chances are that you’ll try to use as many CLI tools as possible. Recently I’ve found out about Tizonia – open source project which allows you to connect to some of the most popular music services.

List of currently available integrations:

  • Spotify
  • Music Google play
  • SOUNDCLOUD
  • YouTube
  • Dirble
  • Plex
  • Google Chromecast

This is active project which have integration with Pandora and Tidal in the road map together with REPL command line interface.

Tizonia - print screen

Installation

Tizonia is available for Debian/Ubuntu/Raspbian Linux family and Arch Linux. Also, you can install it, using Snap package or Docker image.

Configuration

For the purpose of configuration there is tizonia.conf in following directories:

  • Snap - $HOME/snap/tizonia/current/.config/tizonia
  • Debian or AUR packages - $HOME/.config/tizonia/tizonia.conf

If your favorite music service is Spotify and you don’t want to enter your credentials again and again, you need to find its section in config file and provide name and password. Remember about uncommenting (erase leading hash symbol) right lines like in below example.

# Spotify configuration
# -------------------------------------------------------------------------
# To avoid passing this information on the command line, uncomment
# and configure accordingly
#
spotify.user     = email@email.com
spotify.password = my_password
# spotify.recover_lost_token = false (set to true to continue playback after
#                                     the token has been [spuriously?] lost)
# spotify.allow_explicit_tracks = false (set to true to allow explicit tracks)

Usage

In order to understand how should you run your favorite music, I strongly recommend to execute help command i.e.:

tizonia --help spotify

Spotify options (Spotify Premium required):
  --spotify-user arg                    Spotify user name  (not required if
                                        provided via config file).
  --spotify-password arg                Spotify user password  (not required if
                                        provided via config file).
  --spotify-owner arg                   The owner of the playlist  (this is
                                        optional: use in conjunction with
                                        --spotify-playlist or
                                        --spotify-playlist-id).
  --spotify-recover-lost-token          Allow Tizonia to recover the play token
                                        and keep playing after a spurious token
                                        loss (default: false).
  --spotify-allow-explicit-tracks       Allow Tizonia to play explicit tracks
                                        from Spotify (default: false).
  --spotify-tracks arg                  Search and play from Spotify by track
                                        name.
  --spotify-artist arg                  Search and play from Spotify by artist
                                        name.
  --spotify-album arg                   Search and play from Spotify by album
                                        name.
  --spotify-playlist arg                Search and play public playlists (owner
                                        is assumed the current user, unless
                                        --spotify-owner is provided).
  --spotify-track-id arg                Play from Spotify by track ID, URI or
                                        URL.
  --spotify-artist-id arg               Play from Spotify by artist ID, URI or
                                        URL.
  --spotify-album-id arg                Play from Spotify by album ID, URI or
                                        URL.
  --spotify-playlist-id arg             Play public playlists from Spotify by
                                        ID, URI or URL (owner is assumed the
                                        current user, unless --spotify-owner is
                                        provided).
  --spotify-related-artists arg         Search and play from Spotify the top
                                        songs from a selection of related
                                        artists.
  --spotify-featured-playlist arg       Search and play a featured playlist
                                        from Spotify.
  --spotify-new-releases arg            Search and play a newly released album
                                        from Spotify.
  --spotify-recommendations-by-track-id arg
                                        Play Spotify recommendations by track
                                        ID, URI or URL
  --spotify-recommendations-by-artist-id arg
                                        Play Spotify recommendations by artist
                                        ID, URI or URL.
  --spotify-recommendations-by-genre arg
                                        Play Spotify recommendations by genre
                                        name.

So, for example, if you’d like to listen to some recommendation based on piano genre, you can run it like that:

tizonia --spotify-recommendations-by-genre piano

When Tizonia is running there are following commands available:

  • p - skip to previous file
  • n - skip to next file
  • SPACE - pause playback
  • +/- - increase/decrease volume
  • m - mute
  • q - quit

This application can be run as a daemon, and it can chromecast to your devices. Unfortunately I wasn’t able to make it running on WSL.