amp icon indicating copy to clipboard operation
amp copied to clipboard

:sound: A frictionless way to play music from the command line

Amp (asynchronous music player) is a command-line interface to YouTube that lets you find, play, and pause music with minimal effort. It takes arguments in the form of a YouTube search query and plays the first result in a background process.

  • Usage
  1. Open terminal
  2. Type "amp " + title, artist, lyrics, etc.
  3. Enjoy the music! ** Examples Phrase stuff as a search query - be lazy! #+BEGIN_EXAMPLE $ amp portugal hard being wizard Now playing: It's Complicated Being A Wizard (full) - Portugal. The Man [00:23:01]$

$ amp sotc ost Stopping current song.. Now playing: Shadow of the Colossus OST (Playstation 2) [01:15:51] #+END_EXAMPLE

Some songs can be found with just the lyrics: #+BEGIN_EXAMPLE $ amp ah look at all the lonely people Now playing: the beatles "eleanor Rigby" with lyrics [00:02:07]

$ amp i knew the like the back of my hand Stopping current song.. Now playing: Somewhere Only We Know - Keane (Lyrics) [00:04:15] #+END_EXAMPLE

General usage: #+BEGIN_EXAMPLE $ amp Playback paused. Type 'amp' again to resume.

$ amp Playback resumed.

$ amp yellow Stopping current song.. Now playing: Coldplay - Yellow [00:04:33]

$ amp yellow beatles -v Stopping current song.. Now playing: the beatles- yellow submarine(LYRICS) [00:02:38] Showing video in an external window.

#+END_EXAMPLE

  • Installation ** Requirements
  • Python 3.3+ (recommended) or Python 2.7
  • [[https://mpv.io/installation/][mpv]]
  • Python build tools: pip, setuptools, etc.

The Python 3 version is recommended, and development is focused on that version first. Once you have all of these, amp can be installed from pip (with root privileges). #+BEGIN_EXAMPLE

pip install amp-player

#+END_EXAMPLE

Alternatively, you can build it yourself: #+BEGIN_EXAMPLE $ git clone https://github.com/nivekuil/amp.git $ cd amp $ python setup.py install #+END_EXAMPLE

  • Planned features/fixes
  • List multiple results to choose a song from
  • Filters: by duration, quality, views, etc.
  • Queue songs
  • Song history
  • Handle invalid options more gracefully
  • When external dependency fails, show error output
  • Possiblty rewrite this to use sockets/REST instead of OS-level process control
  • Troubleshooting If playback ends abnormally before anything starts playing, it might be an issue with one of amp's dependencies. Try using =amp --verbose= to get the URL of the video, and then play the URL with mpv directly. If that works, then please submit an issue (or pull request).