Giter Site home page Giter Site logo

psub's Introduction

          _________    ___.    
  ______ /   _____/__ _\_ |__  
  \____ \\_____  \|  |  \ __ \ 
  |  |_> >        \  |  / \_\ \
  |   __/_______  /____/|___  /
  |__|          \/          \/
   

CLI Subsonic Client

Same as mj2p did, I was looking for an elegant Subsonic client but failed. I was then considering about building a command line client. But when I searched the github, I found this interesting project. As an innovation, I add more features based on the original project.

pSub is intended to be very simple and focus just on playing music easily. Don't expect to be able to access advanced configuration of a Subsonic server or playlist management.

pSub is written in Python (written with 3.5 but 2.7 should work) using Click to build the CLI and Requests to handle the communication with the Subsonic API.
It should run on most operating systems too but this hasn't been tested.

Installation

Dependencies

pSub uses ffplay to handle the streaming of music so that needs to be installed and available as a command line executable before using pSub. (you'll be prompted to download ffplay if pSub can't launch it correctly)

Python, pip and virtualenv also need to be installed

Instructions

(Tested on Ubuntu, other operating systems may vary)

  • Clone this repo
    git clone https://github.com/hyphenzhao/psub.git
  • Enter the pSub directory
    cd psub
  • Create a virtualenv
    virtualenv ve
    or
    python3 -m venv ve
  • Install pSub
    ve/bin/pip install .
  • Run pSub
    ve/bin/pSub

Usage

On first run you will be prompted to edit your config file. pSub will install a default config file and then open it for editing in your default text editor. You need to specify the url, username and password of your Subsonic server at a minimum.
There are also some settings for adjusting your playback options. The settings are all described in detail in the config file itself.
pSub will run a connection test once your config been saved to make sure it can communicate correctly with Subsonic.
You can edit your config or run the connection test at any time with the -c and -t command line flags.

Commands

Once pSub is properly configured, you can start playing music by running any of the commands shown below.

Usage: pSub [OPTIONS] COMMAND [ARGS]...  

Options:  
  -c, --config  Edit the config file  
  -t, --test    Test the server configuration
  -h, --help    Show this message and exit.

Commands:
  album     Play songs from chosen Album
  artist    Play songs from chosen Artist
  playlist  Play a chosen playlist
  radio     Play endless Radio based on a search
  random    Play random tracks
  video     Play video or videos in a directory

Details

Here are some animations of the commands in action:

album

psub album (functions involving a search will accept * as a wildcard)

artist

psub artist (the -r flag indicates that tracks should be played back in a random order)

playlist

psub playlist (playlist must exist on the Subsonic server first)

After entering into play mode, there will be a few more controls:

n Play next track.

b Restart current track.

v Play previous track.

l Show next lyric.

x Exit

Please note that the lyrics are acquired through Netease Music API, which is basically a Chinese cloud music platform. Hence, most information is in Chinese.

radio

psub radio

random

psub random

video

You have to choose an directory entrace at the beginning. After you enter the root directory, it is similar to command in terminal.

cd e.g. cd 4079, cd ..

pl Play videos or videos in the directory

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.