GithubHelp home page GithubHelp logo

theodoor / spop Goto Github PK

View Code? Open in Web Editor NEW

This project forked from schnouki/spop

0.0 1.0 0.0 739 KB

A Spotify client running as a daemon, similar to mpd.

License: GNU General Public License v3.0

Shell 0.16% Lua 0.74% C 96.72% Python 2.37%

spop's Introduction

Welcome to spop!

spop is a Spotify client that works as a daemon (similar to the famous MPD). It is designed to be as simple and straightforward as possible: run it, control it with your keyboard and a few scripts, and just forget about it.

Features

  • Works as a daemon: no GUI, just start it, it will run in the background and do what you want it to do. Your music won't stop playing if your X server crashes!
  • Uses libspotify: stable, reliable. Not free (a Spotify premium account is required), but quite cheap.
  • Written in plain C: as lightweight as possible, only 300 kB when compiled with debugging symbols...
  • Few dependencies: only requires libspotify, Glib, JSON-GLib and libao (or libsox; not required for OSS audio output).
  • Powerful audio effects: when using libsox, you can apply various effects to the audio output: equalisation, normalisation, reverb, "karaoke", etc. SoX is the Swiss Army knife of sound processing!
  • Powerful plugin system: you can write your own plugin in a few dozens lines of code.
  • Simple protocol: open a TCP connection to the daemon, write a simple plain-text command, get an easily parsable JSON output.
  • Portable: designed to be platform-agnostic, it should work on any platform supported both by Glib and libspotify. (But so far it has only been tested on Linux and Apple OS X)
  • Free software: the source code is available under the terms of the GNU GPLv3 license (or, at your option, any later version), with an exception allowing to distribute code linked against libspotify. Everyone is welcome to contribute!

Plugins

Right now, several plugins are available:

  • notify: use libnotify for desktop notifications
  • savestate: keep the current state (queue, current track, etc.) when stopping and restarting spop
  • scrobble: scrobble your music to LastFM or LibreFM (requires libsoup)
  • awesome: keep an eye on your player in Awesome, an extremely powerful window manager

How to use

  1. Install libspotify (preferably using your favorite package manager)

  2. Download spop's source code:

     git clone git://github.com/Schnouki/spop.git
    
  3. Prepare your configuration file:

     mkdir -p ~/.config/spopd
     cp spop/spopd.conf.sample ~/.config/spopd/spopd.conf
     nano ~/.config/spopd/spopd.conf
    
  4. Compile and run spop:

     cd spop
     ./build_and_run -fv
    
  5. Connect to the daemon and issue some commands:

     telnet localhost 6602
    

If you want to install spop somewhere on your system, do the following steps:

mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/where/to/install ..
make
sudo make install

Commands

At the moment, spop can not modify your playlists or do any search on Spotify (but this will come...). So you will have to create some playlists using the official Spotify client. Then, you will be able to use the following commands:

  • ls: list all your playlists
  • ls pl: list the contents of playlist number pl

  • qls: list the contents of the queue
  • qclear: clear the contents of the queue
  • qrm tr: remove track number tr from the queue
  • qrm tr1 tr2: remove tracks tr1 to tr2 from the queue

  • add pl: add playlist number pl to the queue
  • add pl tr: add track number tr from playlist number pl to the queue
  • play pl: replace the contents of the queue with playlist pl and start playing
  • play pl tr: replace the contents of the queue with track tr from playlist pl and start playing

  • uinfo uri: display information about the given Spotify URI
  • uadd uri: add the given Spotify URI to the queue (playlist, track or album only)
  • uplay uri: replace the contents of the queue with the given Spotify URI (playlist, track or album only) and start playing

  • search query: perform a search with the given query

  • play: start playing from the queue
  • toggle: toggle pause mode
  • stop: stop playback
  • seek pos: go to position pos (in seconds) in the current track
  • next: switch to the next track in the queue
  • prev: switch to the previous track in the queue
  • goto tr: switch to track number tr in the queue
  • repeat: toggle repeat mode
  • shuffle: toggle shuffle mode

  • status: display informations about the queue, the current track, etc.
  • idle: wait for something to change (pause, switch to other track, new track in queue...), then display status. Mostly useful in notification scripts.
  • image: get the cover image for the current track (base64-encoded JPEG image).
  • offline-status: display informations about the current status of the offline cache (number of offline playlists, sync status...).
  • offline-toggle pl: toggle offline mode for playlist number pl.

  • bye: close the connection to the spop daemon
  • quit: exit spop

Furthermore...

This doc is probably lacking a gazillion useful informations, so feel free to ask me if you have any question regarding spop!

spop's People

Contributors

schnouki avatar theodoor avatar

Watchers

 avatar

spop's Issues

1-character arguments cause parse errors.

If an command is send with at least 1 argument with only 1 character the parsing of the command fails.

Temporary solution is to make sure all arguments have at least 2 characters: for example 00 and 01 instead of 0 and 1.

This bug occurs only in some installations, for me after an reinstall on OS X 10.8.2 with Glib 2.34.1.

Malloc failed

2012-11-19 12:22:05 [DBG ] End of track.
2012-11-19 12:22:05 [DBG ] Got next_track event.
2012-11-19 12:22:05 [DBG ] Switching to next track.
2012-11-19 12:22:05 [DBG ] Stopping playback.
2012-11-19 12:22:05 [DBG ] Unloading track.
2012-11-19 12:22:05 [DBG ] Switching to track 1.
2012-11-19 12:22:05 [DBG ] Playing track 1.
2012-11-19 12:22:05 [DBG ] Loading track.
spopd(15033,0x7fff79bde180) malloc: *** mmap(size=140737488355328) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
GLib 2012-11-19 12:22:05 [ERR ] gmem.c:230: failed to allocate 140737488355328 bytes

RUN FINISHED; Trace/BPT trap: 5; real time: 2h 26m 2s; user: 37s; system: 2m 7s

Critical crash

2012-11-15 09:41:08 [DBG ] [ice:13] Received command: next
2012-11-15 09:41:08 [DBG ] Command: [next] with 0 parameter(s)
2012-11-15 09:41:08 [DBG ] Switching to next track.
2012-11-15 09:41:08 [DBG ] Already stopped: nothing to do.
2012-11-15 09:41:08 [DBG ] Reached end of queue, stopping playback.
GLib 2012-11-15 09:41:08 [CRIT] GIOStatus g_io_channel_write_chars(GIOChannel *, const gchar *, gssize, gsize *, GError **): assertion `channel->is_writeable' failed

RUN FINISHED; Segmentation fault: 11; real time: 42m 21s; user: 110ms; system: 270ms


2012-11-15 10:01:39 [DBG ] [ice:14] Received command: shuffle
2012-11-15 10:01:39 [DBG ] Command: [shuffle] with 0 parameter(s)
GLib 2012-11-15 10:01:39 [CRIT] GIOStatus g_io_channel_write_chars(GIOChannel *, const gchar *, gssize, gsize *, GError **): assertion `channel->is_writeable' failed

RUN FINISHED; Segmentation fault: 11; real time: 16m 8s; user: 250ms; system: 350ms

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.