Created
July 28, 2019 19:50
-
-
Save silveira/b67ed05d73bb3289dce69f188fe58c8a to your computer and use it in GitHub Desktop.
Renaming a bunch of sailor moon episodes so PLEX can understand them
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 glob, os | |
os.chdir("E:\Anime\Seriados\Sailor Moon") | |
offset = 46 | |
for file in glob.glob("*.mkv"): | |
if (file.find("Sailor_Moon_R")!=-1): | |
pieces = file.split("_") | |
old_number = int(pieces[6]) | |
new_number = old_number + offset | |
pieces[6] = str(new_number) | |
new_name = "_".join(pieces) | |
print(file, new_name) | |
os.rename(file, new_name) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment