
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.
python --version.To avoid dependency conflicts, use a virtual environment:
Create a virtual environment:
python -m venv env
Activate it:
env\Scripts\activatesource env/bin/activateInstall the necessary Python libraries using pip:
pip install requests beautifulsoup4
Clone the repository:
git clone https://github.com/MichalAFerber/IMDbMovieFileFixer.git
Navigate to the project directory:
cd IMDbMovieFileFixer
Alternatively, download the script directly from the GitHub repository.
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"
Run the Script: In the terminal, navigate to the project directory and execute:
python IMDBMovieFileFixer.py
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.
Customize the script by modifying IMDbMovieFileFixer.py:
rename_format variable to change the output format (default: “{title} ({year}).{ext}”).correct_grammar function to add or remove grammar corrections (e.g., change “Dont” to “Don’t” or add new patterns).time.sleep(1) to increase the delay between IMDb requests (e.g., time.sleep(2) for rate limit issues).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:
Millers.2013.1080p.BluRay.x264.YIFY.mp4
Dont.Breathe.2016.720p.WEBRip.x264.AAC-ETRG.mkv
Miller's (2013).mp4
Don't Breathe (2016).mkv
The script processes common video file extensions: .mp4, .mkv, .avi, .mov, .wmv. Other file types in the folder are ignored.
python --version).pip install requests beautifulsoup4 to install dependencies.folder_path exists and you have read/write permissions.sudo python IMDbMovieFileFixer.py on Unix).time.sleep(1) to time.sleep(2) or higher.search_imdb function’s URL or headers if IMDb’s structure changes.search_imdb function for better filtering if needed.open(filename, 'r', encoding='utf-8')).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.
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)).
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.
Contributions are welcome! To contribute:
For major changes, open an issue first to discuss with the maintainer.
This tool uses IMDb data for title verification. Ensure compliance with IMDb’s Conditions of Use. Avoid excessive requests to prevent rate limiting.
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.
For support or questions, contact the maintainer via GitHub Issues.