movie-renamer

A simple command line interface to rename movies in a folder and get your movies collection organized!

It works in an interactive way and uses imdb gem to query imdb about current movie trying to obtain useful infos

to see the usage type

$ movie-renamer -h
Usage: movie-renamer [-i|-s|-f|-h|-p] <folder>
    Default behavior is -f on current working directory
    -h, --help                       Display this help
    -i, --imdb                       Executes a query on imdb on <movie name>
    -s, --singlemovie FILE           Acts on a single movie file <file name>
    -f, --folder FOLDER              Acts on whole folder <folder>
    -p, --path PATH                  path for moving renamed movies default is tmp/ in current working directory

How it works

Default behavior is to scan the current working directory. For each movie in the folder a question about what to do is asked.

Then movie is renamed using input provided by the user. You can query imdb using the filename or enter use manual search

Each renamed movie is moved into a tmp/ subfolder of the current working directory or in the folder specified with the -p option

By default Movies are renamed like this:

$year - $director - $title partXX.file_extension

You can set the rename pattern creating a .movie-renamer file in your home

example:

filename: ($year) - $title - $director

Multilangual support

Optionally a language for the search can be set in .movie-renamer file

language: it

all languages supported by imdb are available, simply set the language option to the website .part link www.imdb.it -> it

In this case search will return the complete title but then just the title in the selected language will be writed in the filename

Please NOTE that multilanguage support REQUIRES an UTF-8 enabled terminal to work correctly

Change default savepath

savepath: /home/ghedamat/movies

Setting this variable you can change the default savepath to save in the same path all the renamed movies. The behavior is the same as with -p option.

Add a pattern to parse movie filenames

If option “parsepattern” is set the pattern is used to parse movie filenames trying to detect $director $artist and $year

parsepattern: $year - $director - $title

Notes on install

movie-renamer requires ruby1.9 to work correctly gem dependencies also includes

imdb gem
htmlentities gem
highline gem

also ensure that you have the gem installation path in your $PATH to use the included executables

Note on Patches/Pull Requests

You are encouraged to provide help in developing this simple but useful (I hope) application!

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

  • Send me a pull request. Bonus points for topic branches.

Copyright © 2010 ghedamat. See LICENSE for details.

Feel free to send me suggestions :) Please drop me a line if you find this useful

Mail me at: thamayor [at] gmail [dot] com