Mirror of https://gitlab.com/mmstick/tv-renamer

Overview

Build Status: Build Status

Features

  • Written safely in the Rust programming language
  • Features both a command-line and GTK3 interface
  • Support for Templates to define custom naming schemes
  • TVDB Support for obtaining episode titles from TheTVDB
  • Automatically infers whether the input directory contains seasons or episodes
  • Only renames videos whose extensions can be found in /etc/mime.types

Installation Instructions

This project is using a Makefile for generating a busybox-style binary, named tv-renamer, which provides two options: cli and gtk. Ensure that you have a modern stable version of Rust installed via rustup. If you are packaging for Debian, ensure that you have cargo deb installed.

make && sudo make install

GTK3 Manual

GTK3 Screenshot

The use of this application should be fairly straightforward. The program uses the /etc/mime.types file to only detect videos in a given directory, and does not make a distinction between what is or is not part of the series, so ensure that the only video files in the directory that you are renaming contains the episodes that you are wanting to rename, and ensure that the episodes are in alphabetical order. The application does not derive the episode number from the episode name, but by their alphabetical order in the directory.

  • Season Name: The name of the TV series to be renamed.

    • This will be automatically inferred from the directory path if no name is set.
  • Season Directory: The location of the base directory where the season folders or episodes are stored.

  • Template: Defines the naming scheme to use when renaming episodes.

  • Season Number and Episode Number: Defines what index to start counting from.

The directory structure for base directories with season folders should be as follows:

Series Title/Specials/{Episodes...}

Series Title/Season 1/{Episodes...}

Series Title/Season 2/{Episodes...}

CLI Manual

If you need help with the usage of the CLI application, this manual page is also included in the program and is invokable with the -h and --help flags. The CLI interface is invoked by executing tv-renamer cli or tv-renamer, followed by your arguments of choice.

CLI Screenshot

NAME:

tv-renamer - rename TV series and movies

DESCRIPTION:

Renames all videos in a directory according to their season and episode. If the given DIRECTORY contains season directories, it will automatically rename episodes in each season. If no DIRECTORY is given, the default path will be the current working directory. It is recommended to use the dry-run option first before committing any changes. If a target file already exists, the command will ask if it is okay to overwrite the file. Please ensure that all of the files in the directory are video files that you want renamed.

OPTIONS:

-d, --dry-run: Runs through all of the files and prints what would happen without doing anything.

-n, --series-name: Sets the name of the series to be renamed. [not optional]

-s, --season-number: Sets the season number to use when renaming a file. [default: 1]

-t, --template: Sets the template that will define the naming scheme. [default: "${Series} ${Season}x${Episode} ${TVDB_Title}"]

-e, --episode-start: Sets the episode number to start counting from. [default: 1]

-p, --pad-length: Sets the number of digits to pad the episode count for. [default: 2]

-v, --verbose: Print the changes that are occurring.

Template Tokens:

  • ${Series}: Name of the TV Series
  • ${Season}: Season of the TV Series
  • ${Episode}: Current Episode Number
  • ${TVDB_Title}: Title of the current episode from TVDB
  • ${TVDB_First_Aired}: The first airing date of the episode from TVDB

EXAMPLE:

When executed inside of a directory with the name of the TV Series

one.mkv two.mkv three.mkv
> tv-renamer -n "series name"
"TV Series 1x01 Episode Title.mkv"
"TV Series 1x02 Episode Title.mkv"
"TV Series 1x03 Episode Title.mkv"

You can define your own naming scheme with --template:

> one.mkv two.mkv three.mkv
> tv-renamer -t "${Series} S${Season}E${Episode} - ${TVDB_Title}"
> "TV Series S1E01 - Episode Title.mkv" "TV Series S1E02 - Episode Title.mkv" "TV Series S1E03 - Episode Title.mkv"

The season name can also be automatically inferred:

"$series/Season1" "$series/Season2"
> tv-renamer "$series" OR cd $series && tv-renamer
"TV Series/Season1/TV Series 1x01.mkv"
"TV Series/Season1/TV Series 1x02.mkv"
...
"TV Series/Season2/TV Series 2x01.mkv"
"TV Series/Season2/TV Series 2x02.mkv"
...

Episode titles can also be pulled from the TVDB and added to the filenames.

> tv-renamer -t "${Series} ${Season}x${Episode} ${TVDB_Title}"
"TV Series/Season1/TV Series 1x01 Episode Title.mkv"

AUTHOR:

Written by Michael Aaron Murphy.

You might also like...
Federated blogging application, thanks to ActivityPub (now on https://git.joinplu.me/ β€” this is just a mirror)

Plume Website β€” Documentation β€” Contribute β€” Instances list Plume is a federated blogging engine, based on ActivityPub. It is written in Rust, with th

Rust wrapper for gphoto2 (mirror of https://git.maxicarlos.de/maxicarlos08/gphoto2-rs)

GPhoto2-rs Rust bindings to libgphoto2 What about gphoto-rs? I know about the other crate (gphoto and gphoto2-sys which was created by @dcuddeback, bu

Cassandra DB native client written in Rust language. Find 1.x versions on https://github.com/AlexPikalov/cdrs/tree/v.1.x Looking for an async version? - Check WIP https://github.com/AlexPikalov/cdrs-async
Cassandra DB native client written in Rust language. Find 1.x versions on https://github.com/AlexPikalov/cdrs/tree/v.1.x Looking for an async version? - Check WIP https://github.com/AlexPikalov/cdrs-async

CDRS CDRS is looking for maintainers CDRS is Apache Cassandra driver written in pure Rust. πŸ’‘ Looking for an async version? async-std https://github.c

A CLI command to parse kustomize build result and notify it to GitLab

ksnotify A CLI command to parse kustomize build result and notify it to GitLab Caution This repository is under development status. What ksnotify does

GitLab Deploy is used for deploying software projects to multiple hosts during different phases.

GitLab Deploy is used for deploying software projects to multiple hosts during different phases. This program should be run on Linux.

Retrieving SSH and GPS keys from GitHub and GitLab

Dormarch Retrieving SSH and GPS keys from GitHub and GitLab Usage After having installed Dormarch, you can see all the options with dormarch -h. To re

Everyday-use client-side map-aware Arch Linux mirror ranking tool

Rate Arch Mirrors This is a tool, which fetches mirrors, skips outdated/syncing Arch Linux mirrors, then uses info about submarine cables and internet

memflow based dxgi screen mirror prototype
memflow based dxgi screen mirror prototype

memflow-mirror work in progress framebuffer mirror based on memflow. Installation Compile the guest-agent on Windows with: cargo build --release --bin

Check the reproducibility status of your Arch Linux packages (read-only mirror)
Check the reproducibility status of your Arch Linux packages (read-only mirror)

arch-repro-status A CLI tool for querying the reproducibility status of the Arch Linux packages using data from a rebuilderd instance such as reproduc

A library that creates a terminal-like window with feature-packed drawing of text and easy input handling. MIRROR.

BearLibTerminal provides a pseudoterminal window with a grid of character cells and a simple yet powerful API for flexible textual output and uncompli

Userspace libpcap-based tool to mirror your dns traffic

DNS traffic mirroring tool (dns-mirror) Description Userspace libpcap-based tool. dns-mirror sniffs dns packets on the given interface and proxies it

Mirror of oxipng for pre-commit.

oxipng pre-commit mirror Mirror of oxipng for pre-commit. Installation Add to your pre-commit config: - repo: https://github.com/adamchainz/pre-comm

Coreutils - upstream mirror

These are the GNU core utilities. This package is the union of the GNU fileutils, sh-utils, and textutils packages. Most of these programs have sign

By mirroring traffic to and from your machine, mirrord surrounds your local service with a mirror image of its cloud environment.
By mirroring traffic to and from your machine, mirrord surrounds your local service with a mirror image of its cloud environment.

mirrord lets you easily mirror traffic from your Kubernetes cluster to your development environment. It comes as both Visual Studio Code extension and

A fast, efficient osu! beatmap mirror written in asynchronous Rust

A fast, efficient osu! beatmap mirror written in asynchronous Rust. Supports cheesegull, aswell as osu!api v2 formats.

An implementation of a mirror SponsorBlock server in Rust.

sponsorblock-mirror This is a Rust-based mirror of the SponsorBlock API. It also uses sb-mirror for mirroring the CSV dumps via rsync. Instances spons

Github mirror of codeberg repo. Monitor live bandwidth usage/ network speed on PC. Native version also available for Android, separately.
Github mirror of codeberg repo. Monitor live bandwidth usage/ network speed on PC. Native version also available for Android, separately.

Netspeed Monitor Netspeed is a cross-platform desktop application that shows the live upload speed, download speed and day's usage as an overlay. Feat

A mirror of lib.rs/main

Lib.rs (Crates.rs) Lib.rs is a fast, lightweight index of Rust libraries and applications. Crates published to crates.io will automatically show up on

 Video Management System. Mirror of Codeberg.
Video Management System. Mirror of Codeberg.

Screenshots | Changelog | Codeberg | Matrix Overview Full resolution live view with sub 2 second delay 24/7 recording to custom database TFlite object

Comments
  • Fix missing WM_CLASS

    Fix missing WM_CLASS

    Hi, this PR fixes missing WM_CLASS in tv-renamer-gtk (resulting in WM's showing the proper Name=... stanza from the desktop file instead of a dot). Similar fix as in systemd-manager.

    Thanks for your nicely developed applications.

    Regards

    opened by glitsj16 0
  • Strip invalid characters from Episode name

    Strip invalid characters from Episode name

    Example:

    "./Season 2/PUNCH_Psycho_Pass_2_11.mp4" -> "./Season 2/Psycho Pass - 2x11 - What Color?.mp4"
    

    The "?" is a invalid character for file names or folders.

    I'm using "Windows Subsystem for Linux".

    opened by elvishp2006 2
  • Building on headless box

    Building on headless box

    It would be nice to be able to build and run the CLI version without having to install GUI dependencies.

       Compiling xml-rs v0.3.6
    error: failed to run custom build command for `glib-sys v0.3.4`
    process didn't exit successfully: `/home/ramblurr/src/tv-renamer-0.3.3/target/release/build/glib-sys-a1c4d3eee579d2bf/build-script-build` (exit code: 1)
    --- stderr
    `"pkg-config" "--libs" "--cflags" "glib-2.0 >= 2.32"` did not exit successfully: exit code: 1
    --- stderr
    Package glib-2.0 was not found in the pkg-config search path.
    Perhaps you should add the directory containing `glib-2.0.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'glib-2.0' found
    
    opened by Ramblurr 1
  • Windows compatibility?

    Windows compatibility?

    Hey,

    First of all, this is an amazing little tool. Love how easy it is to use (and the UI is fantastic).

    Is there any thought to releasing a Windows version? I am not sure if there are any compatibility issues but you can use something like trust to automate the testing/building for the binary releases.

    opened by RudraSaga 3
Releases(0.3.3)
Owner
Michael Murphy
System76 engineer; Linux developer; Rust programmer
Michael Murphy
This project now lives on in a rewrite at https://gitlab.redox-os.org/redox-os/parallel

MIT/Rust Parallel: A Command-line CPU Load Balancer Written in Rust This is an attempt at recreating the functionality of GNU Parallel, a work-stealer

Michael Murphy 1.2k Nov 20, 2022
Everyday-use client-side map-aware Arch Linux mirror ranking tool

Rate Arch Mirrors This is a tool, which fetches mirrors, skips outdated/syncing Arch Linux mirrors, then uses info about submarine cables and internet

Nikita Almakov 196 Jan 2, 2023
Mirror of https://gitlab.redox-os.org/redox-os/redox

Redox is an operating system written in Rust, a language with focus on safety and high performance. Redox, following the microkernel design, aims to b

Redox OS 14.3k Jan 3, 2023
Mirror of https://gitlab.redox-os.org/redox-os/ion

Introduction Ion is a modern system shell that features a simple, yet powerful, syntax. It is written entirely in Rust, which greatly increases the ov

Redox OS 1.3k Jan 4, 2023
Mirror of https://gitlab.redox-os.org/redox-os/termion

Documentation Examples Changelog Tutorial Termion is a pure Rust, bindless library for low-level handling, manipulating and reading information about

Redox OS 1.9k Dec 31, 2022
Mirror of https://gitlab.redox-os.org/redox-os/rusttype

RustType RustType is a pure Rust alternative to libraries like FreeType. The current capabilities of RustType: Reading OpenType formatted fonts and fo

Redox OS 567 Dec 5, 2022
This is a mirror of https://gitlab.com/pcasotti/plate

plate Rust library for writing simpler Vulkan code Installation Add the library to your Cargo.toml file: [dependencies] plate = "0.5" Example Example

Pedro Casotti 15 Sep 10, 2022
Szyszka is a simple but powerful and fast bulk file renamer.

Szyszka is a simple but powerful and fast bulk file renamer. Features Written in Rust Available for Linux, Mac and Windows Simple GUI created

RafaΕ‚ Mikrut 649 Dec 28, 2022
This project now lives on in a rewrite at https://gitlab.redox-os.org/redox-os/parallel

MIT/Rust Parallel: A Command-line CPU Load Balancer Written in Rust This is an attempt at recreating the functionality of GNU Parallel, a work-stealer

Michael Murphy 1.2k Nov 20, 2022
Provision your authorized_keys via HTTPS/GitHub/GitLab

Keyps Key Provisioning Service Provision authorized_keys from HTTPS/GitHub/GitLab and automatically keep them up to date. Motivation Problem Provision

Samuel Rounce 6 Apr 27, 2023