Skip to content

Instantly share code, notes, and snippets.

@se7enack
Last active December 22, 2024 22:50
Show Gist options
  • Save se7enack/ce1b2166a13d665db17adb151e1fd3f0 to your computer and use it in GitHub Desktop.
Save se7enack/ce1b2166a13d665db17adb151e1fd3f0 to your computer and use it in GitHub Desktop.
rename torrent files
#!/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