Giter VIP home page Giter VIP logo

subcl's Introduction

Subcl! a command-line client for Subsonic

Based on winsbe01/subcl

Subcl is a semi-interactive command-line client for Subsonic. It only feeds mpd's playlist and keeps no track of it by itself. You can tell it to play a song, album, artist or playlist. If your query is unique, subcl will immediately return. If not, subcl will list all possible matches and ask you for the correct one interactively.

Requirements

  • Ruby 2.0.0+
  • mpd

Setup

You can install subcl easily using gemcutter:

gem install subcl

Create a .subcl file in your home directory (~/.subcl):

server <url of your subsonic server>
username <username for subsonic>
password <password for subsonic>

Optionally it may contain:

max_search_results <number, maximum search results, default 20>
notify_method <one of below, notification system to use, default auto>
	auto - autmatically detect notifcation binary (may be slower)
	growlnotify
	notify-send
random_song_count <number, count songs that are fetched for random-songs
	without argument, default 10>
play_any_on_unknown_command true (if you don't supply any valid command, i.e. subcl foo, it will be interpreted as 'subcl play-any foo'
wildcard_order song,album,artist,playlist (The order in which play-any will sort items)

Currently supported commands

Some commands are available in a short and a long format: [short command] | [long command] ATTRIBUTES

[play] clear play queue and immediately start playing this
pr | play-artist SEARCH_QUERY
pl | play-album SEARCH_QUERY
ps | play-song SEARCH_QUERY
pp | play-playlist SEARCH_QUERY
pn | play-any SEARCH_QUERY
r  | play-random [COUNT]

[queue-next] add this after the current song
nr | queue-next-artist SEARCH_QUERY
nl | queue-next-album SEARCH_QUERY
ns | queue-next-song SEARCH_QUERY
np | queue-next-playlist SEARCH_QUERY
nn | queue-next-any SEARCH_QUERY

[queue-last] add this to the end of the play queue
lr | queue-last-artist SEARCH_QUERY
ll | queue-last-album SEARCH_QUERY
ls | queue-last-song SEARCH_QUERY
lp | queue-last-playlist SEARCH_QUERY
ln | queue-last-any SEARCH_QUERY

albumart-url [SIZE] : Prints the url for the albumart of the currently
playing song to stdout. Note that the url will contain your basic auth
credentials in clear text.

status [format] : If a song is playing, prints its info according to
the format string. Otherwise, tells if mpd is paused/stopped/off.
Default format string: '%artist - %title'
Keys are directly pulled from the [subsonic API](http://www.subsonic.org/pages/inc/api/examples/song_example_1.xml)

play
pause
toggle (play or pause)
stop
next
previous
rewind (go to start of song or previous song)

When choosing interactively, you can choose numbers, ranges, or 'all'. Examples:

5
3, 5, 8-12
all

Notification System

By default, if you call subcl from a place where it cannot output anything to the tty (such as a shell script or a launcher), it will try to use your system's notification mechanism to notify you of errors. This can be configured via the notify_method in ~/.subcl.

Status Codes

  • 1: An error occured communicating with the server
  • 2: Your query returned no results
  • 3: Invalid command line arguments
  • 4: Broken configuration

Issues

  • no support for HTTPS (does mpd even support this?)
  • password is stored in plain text
  • limited control over the mpd playlist, and the mpc playlist only shows URLs for songs it hasn't played yet (a possible fix for this might be generating playlists containing the ID3 tags and feeding it to mpd instead of the pure URLs)

Coming Up

  • wildcard play command (don't have to specify if it's a song, an album...) with configurable order for non-interactive mode (First, if it's a song name, play this song. otherwise, if it's an album...)
  • currently playing command showing song metadata
  • announce currently playing song via notification system

Ideas

  • podcasts
  • make a useful search/browse command (maybe with curses?)
  • configurable verbosity

vim: set noexpandtab:

subcl's People

Contributors

tourn avatar spijet avatar latzer avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.