makes consuming media so fast and easy that one might consume too much
Cons is a command line media library primarily for consuming temporary media. Like iTunes but for video, pdfs, and audio. It’s not intended for managing a permanent music/video library. Files can also be removed/added through normal file management tools.
- Ruby
- youtube-dl (recommended if you want to download videos)
- aria2 (recommended not required)
cd ~/src git clone https://github.com/scottjad/cons.git ln -s ~/src/cons/cons ~/bin/cons # or add to PATH cp ~/src/cons/config.default ~/.cons_config.rb $EDITOR ~/.cons_config.rb # setup your apps mkdir ~/Desktop/cons # unless your library already exists
Task | Command |
---|---|
Show library | cons |
Add item from url | cons http://youtu.be/1xVw6PsSinI |
Play item | cons 0 |
Play item selected from dmenu | cons - |
Replay last item played | cons last |
Consume next new item | cons next |
Remove item | cons rm 0 |
Remove all consumed non-sticky items | cons clean |
Mark item for keepin’ | cons keep 0 |
Add item to queue for later | cons http://youtu.be/0dx-7vwJJrc queue |
Retry failed/queued downloads | cons retry |
Add item from file | cons mv ~/video.mp4 |
If you use “-” as an id, such as “cons -” or “cons rm -“, then cons will prompt you for the item using dmenu.
In the file listing there are flags to designate various states. “*” means consumed and “!” means don’t delete.
The id’s listed will persist until you do another listing. So if you remove item 0, item 1 does not become item 0 until you list the library again.
You can leave off the – in options. For example, type “cons keep 0” instead of “cons –keep 0”.
”-” and “last” are special identifiers. Instead of an id, you can use them to interactively choose a file with dmenu or use the last item consumed, respectively. For example, “cons rm -” to choose a file to delete, or “cons keep last” to mark the last item consumed for keeping.
There are a few shortcuts that only work as the first parameter, such as “cons http://foo.com/bar” (shortcut for “cons –url http://foo.com/bar”) and “cons 0” (shortcut for “cons –item 0”)
By default items added to the library are placed under the misc folder. If you would like to put them in a different folder when adding use the –dir option, e.g. “cons –dir youtube –url http://www.youtube.com/watch?v=T2xh9-UPSlU”
export CONS_PLAYBACK_SPEED=1.61
If you use rbrito’s youtube-dl fork (use-other-downloaders branch) then you can use aria2c with 5 (up to 16) concurrent connections.
export cons=~/Desktop/cons cd $cons
Deprecated: Use the integrated dmenu interface instead https://github.com/scottjad/dotfiles/blob/master/.stump/cons.lisp
They return immediately so the file gets marked as consumed and renamed sometimes before the program has a chance to read it. I haven’t come up with a good solution yet so only use these as last resort.
This is the longest thing I’ve written in ruby. Improvement forks welcome.
Scott Jaderholm < my first name at my last name dot com >