movie-rename/README.md

41 lines
2.9 KiB
Markdown
Raw Normal View History

2023-02-07 20:55:49 -06:00
[![latest-release](https://img.shields.io/github/v/release/SinTan1729/movie-rename?label=latest%20release)](https://github.com/SinTan1729/movie-rename/releases/latest/)
![commits-since-latest-release](https://img.shields.io/github/commits-since/SInTan1729/movie-rename/latest?label=commits%20since%20latest%20release)
2023-02-01 11:32:39 -06:00
[![AUR package](https://img.shields.io/aur/version/movie-rename-bin?label=AUR&logo=archlinux)](https://aur.archlinux.org/packages/movie-rename-bin/)
2022-12-10 22:39:07 -06:00
# `movie-rename`
2022-12-08 01:03:56 -06:00
2022-12-08 22:08:16 -06:00
### A simple tool to rename movies, written in Rust.
2022-12-08 01:03:56 -06:00
2023-02-26 00:49:29 -06:00
It turns a file like `Apur.Sansar.HEVC.2160p.AC3.mkv` into `Apur Sansar (1959) - Satyajit Ray.mkv` using metadata pulled from [TMDB](https://www.themoviedb.org/).
2022-12-10 22:39:07 -06:00
This is made mostly due to [mnamer](https://github.com/jkwill87/mnamer) not having support for director's name, and also because I wanted to try writing something useful in Rust.
2022-12-08 01:03:56 -06:00
2022-12-08 22:08:16 -06:00
## Installation
2022-12-10 23:33:09 -06:00
Install from [AUR](https://aur.archlinux.org/packages/movie-rename-bin), my personal [lure-repo](https://github.com/SinTan1729/lure-repo) or download the binary from the releases. You can also get it from [crates.io](https://crates.io/crates/movie-rename).
2022-12-08 01:03:56 -06:00
2023-02-25 22:45:59 -06:00
You can also install from source by using
```
git clone https://github.com/SinTan1729/movie-rename
cd movie-rename
sudo make install
```
2022-12-10 22:39:07 -06:00
## Usage
- The syntax is:
2022-12-08 22:08:16 -06:00
2022-12-09 15:03:10 -06:00
`movie-rename <filename(s)> [-n|--dry-run] [-d|--directory] [-h|--help] [-v|--version]`
2022-12-10 18:39:33 -06:00
- There needs to be a config file named `config` in the `$XDG_CONFIG_HOME/movie-rename/` directory.
2023-02-26 00:49:29 -06:00
- It should consist of two lines. The first line should have your [TMDB API key](https://developers.themoviedb.org/3/getting-started/authentication).
2022-12-08 01:03:56 -06:00
- The second line should have a pattern, that will be used for the rename.
2023-03-09 09:37:37 -06:00
- In the pattern, the variables need to be enclosed in `{}`, the supported variables are `title`, `year` and `director`.
2022-12-08 01:03:56 -06:00
- Default pattern is `{title} ({year}) - {director}`. Extension is always kept.
2022-12-10 18:39:33 -06:00
- Passing `--directory` or `-d` assumes that the arguments are directory names, which contain exactly one movie and optionally subtitles.
- Passing `--dry-run` or `-n` does a dry tun and only prints out the new names, without actually doing anything.
- Passing `--i-feel-lucky` or `-l` automatically chooses the first option. Useful when you use the program as part of a script.
- You can join the short flags `-d`, `-n` and `-l` together (e.g. `-dn` or `-dln`).
2022-12-10 18:39:33 -06:00
- Passing `--help` or `-h` shows help and exits.
- Passing `--version` or `-v` shows version and exits.
2022-12-08 01:03:56 -06:00
2022-12-10 22:39:07 -06:00
## Notes
- Currently, it only supports names in English. It should be easy to turn it into a configurable option. Since for movies in all the languages I know, English name is usually provided, it's a non-feature for me. If someone is willing to test it out for other languages, they're welcome. I'm open to accepting PRs.
2022-12-09 15:46:38 -06:00
- I plan to add more variables in the future. Support for TV Shows will not be added, since [tvnamer](https://github.com/dbr/tvnamer) does that excellently.