Last active
January 14, 2023 12:57
-
-
Save Haaroon/32c678e1a11b4cf3b47bd615afef6a68 to your computer and use it in GitHub Desktop.
rename downloaded one pace files into proper SXXEXX format
This file contains hidden or 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 | |
def run(season): | |
files = sorted([file for file in os.listdir('.') if file.startswith("One.Piece")]) | |
for i, file in enumerate(files, 1): | |
new_name = f"One.Piece.S{season}E{str(i).zfill(2)}.mkv" | |
print(f"{file} -> {new_name}") | |
if input("Do You Want To Continue? [y/n]") == "y": | |
for i, file in enumerate(files, 1): | |
new_name = f"One.Piece.S{season}E{str(i).zfill(2)}.mkv" | |
os.rename(file, new_name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Cd into your season folder
Open up a python shell
Paste this into shell
then run
Where you must put the season number
script will show you what it will do, press y and enter and then it will run,