Skip to main content

CLI tools for finding, organizing, and playing audio files

Project description

Install

Install the actual MOC player/server

% sudo apt-get install -y moc

or

% brew install moc

Install Redis and start server

% sudo apt-get install -y redis-server

or

% brew install redis@3.2
% brew services start redis@3.2

Install with pip

% pip3 install mocp-cli

Optional Installs

yt-helper

A lot of what powers the cool interactive features are provided by the COMMENTS and FILES collections defined in yt_helper.

Install system av tools

% sudo apt-get install -y libav-tools sox rtmpdump

or

% brew install libav sox rtmpdump

Install with pip

% pip3 install yt-helper

Usage

The mocplayer script is provided

$ venv/bin/mocplayer --help
Usage: mocplayer [OPTIONS] [GLOB_PATTERNS]...

  Start a REPL to control music on console player (mocp)

Options:
  --help  Show this message and exit.

Calling mocplayer will start a REPL that will send commands to the running instance of mocp --server. Any arguments passed to mocplayer are assumed to be glob patterns that should be passed to the moc.find_and_play function.

% venv/bin/mocplayer
:docstrings to see all colon commands
:shortcuts to see all hotkeys

mocplayer> ?
 Loop forever, receiving character input from user and performing actions

    - ^d or ^c to break the loop
    - ':' to enter a command (and any arguments)
        - any method defined on GetCharLoop (or a sub-class) will be callable
          as a "colon command" (if its name does not start with '_')
        - the method for the `:command` should only accept `*args`
    - '-' to allow user to provide input that will be processed by the `input_hook`
    - '?' to show the class docstring(s) and the startup message

A wrapper to control moc (music on console) player with vim keybindings

:docstrings to see all colon commands
:shortcuts to see all hotkeys

mocplayer> :docstrings
.:: delete_comments ::.
Select comments/marks for currently playing file to delete

.:: docstrings ::.
Print/return the docstrings of methods defined on this class

.:: edit_timestamp ::.
Select comment/mark for currently playing file to edit the timestamp

.:: errors ::.
Print/return any colon commands that raised exceptions (w/ traceback)

.:: find ::.
Find and select audio files at specified glob patterns

.:: go ::.
Go to a particular timestamp

.:: history ::.
Print/return successful colon commands used

.:: ipython ::.
Start ipython shell. To continue back to the input loop, use 'ctrl + d'

.:: jump ::.
Jump to a saved comment/mark

.:: jumploop ::.
Loop an unbuffered input session, jumping between selected marks (up to 10)

.:: most_commented ::.
Select files that have been most commented and play

.:: pdb ::.
Start pdb (debugger). To continue back to the input loop, use 'c'

.:: recent_files ::.
Select files that were most recently added and play

.:: seek ::.
Seek forward or backward

.:: shortcuts ::.
Print/return any hotkey shortcuts defined on this class


mocplayer> :shortcuts
' ' -- pause/unpause
'i' -- show info about currently playing file
'm' -- mark the current timestamp
'c' -- show comments/marks (requires yt_helper package)
'C' -- select files that have been most commented and play (requires yt_helper package)
'R' -- select files that were most recently added and play (requires yt_helper package)
'J' -- jump to a saved comment or mark (requires yt_helper package)
'e' -- select comment/mark to edit timestamp (requires yt_helper package)
'd' -- select comments/marks to delete (requires yt_helper package)
'f' -- find and play audio files found in current directory
'F' -- find, select, and play audio files found in current directory
'q' -- quit
'Q' -- stop MOC server and quit
'n' -- next file in playlist
'p' -- previous file in playlist
'H' -- rewind 30 seconds
'h' -- rewind 5 seconds
'\x1b[D' -- rewind 1 second (left arrow)
'L' -- fast foward 30 seconds
'l' -- fast foward 5 seconds
'\x1b[C' -- fast foward 1 second (right arrow)
'j' -- lower volume
'\x1b[B' -- lower volume (down arrow)
'k' -- raise volume
'\x1b[A' -- raise volume (up arrow)

mocplayer> i
00:55 (55) of 43:03 into /tmp/Samurai_Champloo_-_Lofi_HipHop_Mix_Nujabes_inspired-kq7cQNO0gYc.mp3
mocplayer> :go 12:00
mocplayer> i
12:00 (720) of 43:03 into /tmp/Samurai_Champloo_-_Lofi_HipHop_Mix_Nujabes_inspired-kq7cQNO0gYc.mp3
mocplayer> :go 500
mocplayer> i
08:20 (500) of 43:03 into /tmp/Samurai_Champloo_-_Lofi_HipHop_Mix_Nujabes_inspired-kq7cQNO0gYc.mp3
mocplayer> :seek -45
mocplayer> i
07:42 (462) of 43:03 into /tmp/Samurai_Champloo_-_Lofi_HipHop_Mix_Nujabes_inspired-kq7cQNO0gYc.mp3
mocplayer> L
mocplayer> L
mocplayer> L
mocplayer> i
09:32 (572) of 43:03 into /tmp/Samurai_Champloo_-_Lofi_HipHop_Mix_Nujabes_inspired-kq7cQNO0gYc.mp3

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mocp_cli-0.1.13-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file mocp_cli-0.1.13-py3-none-any.whl.

File metadata

File hashes

Hashes for mocp_cli-0.1.13-py3-none-any.whl
Algorithm Hash digest
SHA256 2ad6c5dd86247a3fb524eb5cc21baac9bb4e20b13a7893ad5690a7cef2f66e91
MD5 63d7705c6520e61ba3058eaeca6c6a44
BLAKE2b-256 e498408864be16c6b9a6073f187eb5f84f4a2c1da727b2e4e4dcfef81b3a10db

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page