Project

spfy

0.0
Repository is archived
No release in over 3 years
Low commit activity in last 3 years
Spfy is a simple command-line tool for generating XSPF playlists from metadata stored in several popular audio formats.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0.5.0
 Project Readme

Spfy ("spiffy")

Overview

Spfy is a command-line tool for generating XSPF playlists from metadata stored in several popular audio formats and is developed entirely in Ruby. It takes one or more local directory paths as input, extracts metadata tags from any audio files that it encounters, and generates a valid XSPF playlist.

Prerequisites

A working Ruby installation (version 1.9 or greater) is required for Spfy to work, but this is outside the scope of this guide. For more information refer to the official installation procedure.

TagLib is also required. Follow the steps below (taken from the taglib-ruby installation guide) to install the necessary files for your respective system type:

System: Command:
Debian/Ubuntu sudo apt-get install libtag1-dev
Fedora/RHEL sudo yum install taglib-devel
Brew brew install taglib
MacPorts sudo port install taglib

Installation

With the prerequisites above taken care of Spfy can be installed with the following command:

$ gem install spfy

Using Spfy

By default, Spfy will output a formatted XSPF playlist to the standard output stream that will include location, title, creator, album, and trackNum elements for each audio file where available.

The general syntax for Spfy is spfy [options] dir1 ... dirN, where dir1 ... dirN is one or more paths to directories containing audio files.

For example:

$ spfy ~/music

..will produce the following output (where ~/music contains one audio file with valid metadata):

<?xml version="1.0" encoding="UTF-8"?>
<playlist version="1" xmlns="http://xspf.org/ns/0/">
	<trackList>
		<track>
			<location>file:///Users/spfy/music/03%20A%20Stitch%20In%20Time.mp3</location>
			<title>A Stitch In Time</title>
			<creator>The Smashing Pumpkins</creator>
			<album>Teargarden by Kaleidyscope</album>
			<trackNum>3</trackNum>
		</track>
	</trackList>
</playlist>

Spfy supports multiple directory paths (e.g. spfy /dir1 /dir2) and traverses each directory recursively by default. Unsupported files and empty directories in a directory tree are silently ignored and will not impact Spfy's output.

Command-line arguments allow you to control which elements Spfy outputs:

-f, --no-location                Suppress file location output
-t, --no-title                   Suppress track title in output
-a, --no-artist                  Suppress artist name in output
-l, --no-album                   Suppress album name in output
-n, --no-tracknum                Suppress track number in output

For additional options use spfy --help.

License

Spfy is free software, and you are welcome to redistribute it under certain conditions. See the GNU General Public License for more details.

Acknowledgements

Spfy uses the following third party software components:

Contact

Email me at marc.ransome@fidgetbox.co.uk or create an issue.