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.
- Open terminal
- Type “amp ” + title, artist, lyrics, etc.
- Enjoy the music!
Phrase stuff as a search query - be lazy!
$ 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]
Some songs can be found with just the lyrics:
$ 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]
General usage:
$ 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.
- Python 3.3+ (recommended) or Python 2.7
- 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).
# pip install amp-player
Alternatively, you can build it yourself:
$ git clone https://github.com/nivekuil/amp.git $ cd amp $ python setup.py install
- 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
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).