Mediaman manages your media, man.
Have video files you need to organize? DVD backups or something? Need to do some batch operations? Get everything in order. Mediaman has you covered.
Mediaman comes with a command line interface called, cleverly enough, mediaman
. There's a few little commands for you.
The add command will probably be what you use the most. It does a few things:
-
Figures out what type of media this file represents.
-
Puts it in a simple, easily navigable folder structure.
-
Downloads metadata and artwork about the video and saves it.
-
(Optionally) Adds the video to iTunes.
$ mediaman add ~/movie/file/or/folder
Interesting options:
--batch
or-b
: Adds each file or folder in the passed-in folder to the library. (Not recursive.)--library
or-l
: : Media library base folder to sort into. (Defaults to.
)--itunes
: Tries to add the video file to iTunes after all is said and done.
The ToName gem is responsible for the majority of this smartness, but it can't guess everything.
Here's the general way Mediaman categorizes media files:
-
Movies: Text followed by a four-digit year.
For example:
Star Wars (1977)
orstar.wars.1977.stereo
. -
TV Shows: A name followed by season and episode number information.
For example:
Star Trek The Next Generation S02E03
orPsych 3x02
. -
Anything else is considered Other Media.
Once it figures out what your media is it will throw it into a pretty folder for you. Like:
~/Movies/Star Wars (1977).mov
~/TV Shows/Star Trek - The Next Generation/Season 2/2x03 - Elementary, Dear Data.mov
~/Other Media/Information About Sharks.pdf
If it can, it will add the media's metadata (including artwork) to an mp4
or mkv
file using MiniSubler.
The artwork image and metadata (in YAML format) will also be saved for your reference in an Extras
folder in the same directory as the movie file.
To view a YAML-formatted printout of as much metadata as Mediaman can muster, just use:
$ mediaman metadata ~/path/to/movie.mp4
You can also just pass in a name:
$ mediaman metadata "the truman show 1998"
For more information, there's some help and whatnot available too.
To download metadata, we currently use the Trakt API, for which you can get a free key through their website.
Mediaman looks for this information in the environment variable TRAKT_API_KEY
.
On systems like OS X, the simplest way to have this stick around is to set this in your ~/.bash_profile
like so:
export TRAKT_API_KEY=86f7e437faa5a7fce15d1ddcb9eaeaea377667b8
Want another service? Pull request please!
-
OS X
Tested only with OS X 10.8 Mountain Lion (so far).
-
Ruby 1.9.x
This is not the default Ruby shipped with Mountain Lion. You'll have to figure that one out yourself.
Install as a Ruby gem:
$ gem install mediaman
Or throw it in your Gemfile and use it directly from Ruby. Your move.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request