IMDbMovieFileFixer

IMDbMovieFileFixer

IMDbMovieFileFixer

IMDbMovieFileFixer is a Python script designed to streamline and enhance your movie file organization. This tool automatically renames movie files in a specified folder to a standardized format, corrects common grammar mistakes, and verifies movie titles against official names on IMDb. Unlike similar tools like movie-file-fixer or imdb-rename, it emphasizes grammar correction and detailed logging for transparency, making it ideal for movie enthusiasts and collectors.

Features

Installation

Prerequisites

To avoid dependency conflicts, use a virtual environment:

  1. Create a virtual environment:

    python -m venv env
    
  2. Activate it:

Install Required Libraries

Install the necessary Python libraries using pip:

pip install requests beautifulsoup4

Clone the Repository

  1. Clone the repository:

     git clone https://github.com/MichalAFerber/IMDbMovieFileFixer.git
    
  2. Navigate to the project directory:

     cd IMDbMovieFileFixer
    

Alternatively, download the script directly from the GitHub repository.

Usage

  1. Set the Folder Path: Open IMDbMovieFileFixer.py in a text editor and set the folder_path to your movie directory:

     folder_path = "/path/to/your/movie/folder"
    
  2. Run the Script: In the terminal, navigate to the project directory and execute:

     python IMDBMovieFileFixer.py
    
  3. Review the Log File: Check the generated log file (e.g., _output 2024-12-23 23-40-15.txt) in the project directory for details on changes and discrepancies.

Note: Back up your movie files before running the script to prevent accidental data loss. For large collections, process in smaller batches to avoid IMDb rate limits.

Configuration Options

Customize the script by modifying IMDbMovieFileFixer.py:

Output File

The script generates a log file in the project directory, named with the current date and time (e.g., _output 2024-12-23 23-40-15.txt). It includes:

Example

Before:

Millers.2013.1080p.BluRay.x264.YIFY.mp4
Dont.Breathe.2016.720p.WEBRip.x264.AAC-ETRG.mkv

After:

Miller's (2013).mp4
Don't Breathe (2016).mkv

Supported File Types

The script processes common video file extensions: .mp4, .mkv, .avi, .mov, .wmv. Other file types in the folder are ignored.

Troubleshooting

Installation Issues

Runtime Errors

IMDb Connection Problems

Other Issues

FAQ

General Questions

Q: What happens if there’s a duplicate filename?
A: The script appends an index (e.g., “Movie (2023) [1].mp4”) to ensure uniqueness”.

Q: Can I use this for TV shows or other media?
A: The script is designed for movies. TV show support requires modifications to handle episodic naming.

Q: Does it support non-English movie titles?
A: Yes, but ensure IMDb has the title. Special characters are handled, but complex cases may need custom logic.

Q: What file formats are supported? A: Supports .mp4, .mkv, .avi, .mov, .wmv. Contact the maintainer for additional formats.

Customization

Q: Can I customize the renaming format?
A: Yes, modify rename_format in the script (e.g., “{title} [{year}]”).

Q: How do I change the delay between IMDb requests?
A: Adjust time.sleep(1) in the script to a higher value (e.g., time.sleep(2)).

Technical Issues

Q: What if IMDb’s website changes?
A: Update the search_imdb function’s BeautifulSoup selectors to match IMDb’s new structure.

Q: How do I preview changes before renaming?
A: If IMDb changes its website structure, the script might need updates to the HTML parsing logic. Check the search_imdb function and adjust the BeautifulSoup selectors accordingly.

Q: How do I revert changes?
A: Use the log file to manually rename files back. Automating reversion requires additional scripting.

Contributing

Contributions are welcome! To contribute:

  1. Fork the repository.
  2. Follow PEP 8 coding standards.
  3. Test changes locally with a sample movie folder.
  4. Submit a pull request with a clear description of your changes.

For major changes, open an issue first to discuss with the maintainer.

IMDb Data Usage

This tool uses IMDb data for title verification. Ensure compliance with IMDb’s Conditions of Use. Avoid excessive requests to prevent rate limiting.

License

This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.

Acknowledgements

Contact

For support or questions, contact the maintainer via GitHub Issues.