Skip to content

Compromisee/Bulk-Video-File-Renamer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“Ί Bulk TV Show Renamer

Auto-Detect & Match to TVmaze β€’ Jellyfin / Plex / Emby Compatible β€’ Anime Support

A powerful, user-friendly Python application that automatically detects TV shows in your folders, matches them to TVmaze, and renames them to the perfect format for media servers.


✨ Features

🎯 Core Features

  • Auto-Detection - Scans folders and intelligently extracts show names
  • Auto-Matching - Automatically searches TVmaze for all detected shows
  • Auto-Merging - Combines similar show names (e.g., "Attack On Titan" + "Attack On Titan S2")
  • Anime Support - Handles absolute episode numbering (Naruto #150, etc.)
  • Dry Run Mode - Preview changes before applying them
  • Keyboard Shortcuts - Fast workflow with Ctrl+O, Ctrl+R, Ctrl+S, etc.

πŸ“ Output Format

ShowName - S01E001 - [2008-01-20] - Episode Title.mkv

Perfect for:

  • 🎬 Jellyfin
  • πŸŽ₯ Plex
  • πŸ“Ί Emby
  • πŸ—‚οΈ Kodi

πŸš€ Quick Start

Requirements

pip install customtkinter

Usage

  1. Launch the application
  2. Press Ctrl+O or click "Browse Folder"
  3. Select your TV shows root folder
  4. Press Ctrl+R - Auto-scans and searches TVmaze
  5. Review the matches (change if needed)
  6. Press Ctrl+S to START!

⌨️ Keyboard Shortcuts

Shortcut Action
Ctrl+O Open/Browse folder
Ctrl+R or F5 Scan folder
Ctrl+L Load episodes
Ctrl+S START RENAME
Ctrl+D Toggle Dry Run / Live mode
Escape Clear focus

πŸ“‚ Supported File Formats

  • .mkv - Matroska Video
  • .mp4 - MPEG-4 Video
  • .avi - Audio Video Interleave
  • .m4v - iTunes Video
  • .mov - QuickTime Movie
  • .wmv - Windows Media Video
  • .ts - Transport Stream
  • .flv - Flash Video
  • .webm - WebM Video

🎭 Detected Pattern Examples

Season + Episode Patterns

βœ… Breaking Bad S01E01.mkv
βœ… Breaking.Bad.1x01.mkv
βœ… Breaking Bad - Season 1 Episode 1.mkv
βœ… Breaking Bad - S01.E01.mkv
βœ… Breaking Bad - 1x01.mkv

Absolute Episode (Anime)

βœ… Naruto - 001.mkv
βœ… Naruto - Ep001.mkv
βœ… Naruto - Episode 001.mkv
βœ… Naruto.001.mkv

Auto-Skipped Files

⏭️ S01OP01 - Opening Theme.mkv
⏭️ S01ED01 - Ending Theme.mkv
⏭️ NCOP01.mkv
⏭️ Special - Behind the Scenes.mkv

πŸ› οΈ Advanced Features

πŸ”— Manual Show Merging

Merge shows that were detected as separate:

"Jujutsu Kaisen" + "Jujutsu Kaisen S01 Dd2 0 [pahe Li]"
           ↓
    "Jujutsu Kaisen" (51 files)

πŸ” Custom Search

If auto-match is wrong:

  1. Type custom search term
  2. Press Enter or click πŸ”
  3. Select correct show from dropdown

πŸ“₯ Episode Data Options

  • Include air-date - Adds [2008-01-20] to filename
  • Try absolute episode # - For anime with absolute numbering
  • Organize into folders - Creates ShowName/Season 01/ structure
  • Auto-load episodes - Loads episodes automatically after matching

🎯 How It Works

1️⃣ Scanning Phase

πŸ“ Root Folder
β”œβ”€β”€ Attack on Titan S1/
β”‚   β”œβ”€β”€ Attack.on.Titan.S01E01.mkv
β”‚   └── Attack.on.Titan.S01E02.mkv
└── Attack on Titan S2/
    β”œβ”€β”€ Attack.on.Titan.S02E01.mkv
    └── Attack.on.Titan.S02E02.mkv

πŸ” Detects: "Attack On Titan" (2 folders merged)

2️⃣ Matching Phase

🌐 Searches TVmaze: "Attack On Titan"
βœ… Found: Attack on Titan (2013) [Adult Swim]
πŸ“₯ Loads: 89 episodes across 4 seasons

3️⃣ Renaming Phase

DRY RUN:
  β†’  Attack on Titan - S01E001 - [2013-04-07] - To You, in 2000 Y…
  β†’  Attack on Titan - S01E002 - [2013-04-14] - That Day - The Fa…

LIVE MODE:
  βœ… Attack on Titan - S01E001 - [2013-04-07] - To You, in 2000 Y…
  βœ… Attack on Titan - S01E002 - [2013-04-14] - That Day - The Fa…

🧩 Filler Word Removal

Automatically removes these from show names:

  • Quality: 1080p, 720p, 4K, BluRay, WEB-DL
  • Codecs: x264, x265, HEVC, H.264
  • Audio: AAC, DD5.1, DTS, ATMOS
  • Streaming: AMZN, NF, DSNP, HMAX
  • Release Groups: [YIFY], (PSA), pahe.in, SubsPlease
  • Tags: REPACK, PROPER, INTERNAL

πŸ“Š Example Workflow

Before

D:/
β”œβ”€β”€ attack.titan.s1.fhd.265-pahe.in/
β”‚   β”œβ”€β”€ Attack.on.Titan.S01E01.To.You.1080p.BluRay.x265.DD+2.0-Pahe.in.mkv
β”‚   β”œβ”€β”€ Attack.on.Titan.S01E02.That.Day.1080p.BluRay.x265.DD+2.0-Pahe.in.mkv
β”‚   └── ...
└── attack.titan.s2/
    β”œβ”€β”€ Attack.on.Titan.S02E01.Beast.Titan.mkv
    └── ...

After (with "Organize into folders" enabled)

D:/
└── Attack on Titan/
    β”œβ”€β”€ Season 01/
    β”‚   β”œβ”€β”€ Attack on Titan - S01E001 - [2013-04-07] - To You, in 2000 Years.mkv
    β”‚   β”œβ”€β”€ Attack on Titan - S01E002 - [2013-04-14] - That Day.mkv
    β”‚   └── ...
    └── Season 02/
        β”œβ”€β”€ Attack on Titan - S02E001 - [2017-04-01] - Beast Titan.mkv
        └── ...

πŸ”§ Configuration Options

Sidebar Settings

Option Description Default
Dry Run Preview without changes βœ… ON
Include air-date Add [YYYY-MM-DD] βœ… ON
Try absolute episode # For anime βœ… ON
Organize into folders Create Show/Season structure ❌ OFF
Auto-load episodes Load after search βœ… ON

πŸ› Troubleshooting

Issue: Show detected incorrectly

Solution: Use manual search or merge shows

1. Type correct name in "Custom search"
2. Press Enter or click πŸ”
3. Select from dropdown

Issue: Episodes not matching

Solutions:

  • βœ… Enable "Try absolute episode #" for anime
  • βœ… Check TVmaze has correct episode data
  • βœ… Use custom search to find better match

Issue: File already exists error

Solution: The tool now auto-adds (1), (2), etc. to duplicates

Issue: Opening/Ending themes renamed

Solution: Now auto-skipped (OP01, ED01, NCOP, etc.)


πŸ“ˆ Statistics Display

After each run:

══════════════════════════════════════════════════════════════════
  COMPLETE!
    βœ… Renamed: 141
    ⏭  Skipped: 119
    ❌ Errors:  0
══════════════════════════════════════════════════════════════════

🎨 Color-Coded UI

Color Meaning
🟒 Green (Mint) Success, Ready
πŸ”΅ Blue (Sky) Info, Actions
🟑 Yellow Warning, Dry Run
πŸ”΄ Red Error, Live Mode
βšͺ Gray Neutral, Skipped

🌟 Pro Tips

  1. Always start with Dry Run to preview changes
  2. Review auto-matches - they're usually 95%+ accurate
  3. Use merge feature for shows split across folders
  4. Enable auto-load for fastest workflow
  5. Keyboard shortcuts are your friend: Ctrl+O β†’ Ctrl+R β†’ Ctrl+S

πŸ“ File Naming Convention

Standard Format

{Show Name} - S{Season}E{Episode} - [{Air Date}] - {Title}.{ext}

Examples

βœ… Breaking Bad - S01E001 - [2008-01-20] - Pilot.mkv
βœ… Attack on Titan - S03E022 - [2019-06-30] - Beyond the Wall.mkv
βœ… Jujutsu Kaisen - S02E023 - [2023-12-28] - The Shibuya Incident.mkv

Without Air Date

βœ… Breaking Bad - S01E001 - Pilot.mkv

πŸ”’ Safety Features

  • βœ… Dry Run Default - Always previews first
  • βœ… No File Deletion - Only renames
  • βœ… Duplicate Protection - Won't process same file twice
  • βœ… Backup Recommendation - Always backup before live mode
  • βœ… Path Length Protection - Prevents Windows path-too-long errors
  • βœ… Collision Handling - Adds (1), (2) if file exists

πŸ“š API Credits

This application uses the TVmaze API for show and episode data.

  • API: https://www.tvmaze.com/api
  • Rate Limit: Respects TVmaze guidelines with built-in delays
  • Attribution: TVmaze data is property of TVmaze

πŸ†˜ Support

Common Questions

Q: Does it work with movies? A: No, this is specifically for TV shows.

Q: Can I undo renames? A: No automatic undo. Always use Dry Run first!

Q: What about Naruto numbering? A: Enable "Try absolute episode #" for correct anime numbering.

Q: Why is Naruto showing S2002E001? A: TVmaze organizes Naruto by year. This is correct per their data.

Q: Can I change the output format? A: Not in the GUI, but you can modify the build_name function in the code.


πŸ“œ License

This is free software. Use at your own risk. Always backup your files before using live mode.


🎬 Version History

v2.0 - Current

  • ✨ Auto-search on scan
  • ✨ Keyboard shortcuts
  • ✨ Auto-skip OP/ED/Specials
  • ✨ Duplicate file protection
  • ✨ File exists handling
  • ✨ Ready status badge
  • πŸ› Fixed: Multiple processing of same file
  • πŸ› Fixed: File collision errors

v1.0 - Initial

  • Basic TVmaze matching
  • Manual search workflow
  • Dry run mode
  • Episode detection

πŸ™ Acknowledgments

  • CustomTkinter - Modern UI framework
  • TVmaze - Episode data API
  • Community - Testing and feedback

πŸ“ž Contact

For bugs, suggestions, or questions, please open an issue on GitHub.


Made with ❀️ for the home media server community

Happy renaming! πŸŽ‰

About

Renames ALL diffeerent shows inside a selected folder, this include subfolders.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages