Last active
December 22, 2024 22:50
-
-
Save se7enack/ce1b2166a13d665db17adb151e1fd3f0 to your computer and use it in GitHub Desktop.
rename torrent files
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
#!/usr/bin/env python3 | |
import os | |
string = ".720p.WEB.h264-ETHEL" | |
# Get the current working directory | |
cwd = os.getcwd() | |
# Get a list of all the files in the current directory | |
files = os.listdir(cwd) | |
# Iterate over the files and rename them | |
for file in files: | |
# Get the old and new names of the file | |
old_name = file | |
new_name = file.replace(string, "") | |
# Rename the file | |
os.rename(old_name, new_name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment