Created
July 6, 2018 11:33
-
-
Save mzfr/740f68096fe2d93444aa9b3dded38acf to your computer and use it in GitHub Desktop.
Rename Bad movies names to good one :)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
from guessit import guessit | |
def main(path): | |
for folder in os.listdir(path): | |
movie_info = guessit(folder) | |
movie_name = movie_info['title'] | |
old_path = os.path.join(path, folder) | |
new_path = os.path.join(path, movie_name) | |
os.rename(old_path, new_path) | |
if __name__ == "__main__": | |
main(sys.argv[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment