Skip to content

Instantly share code, notes, and snippets.

@se7enack
Last active January 17, 2024 15:20
Show Gist options
  • Save se7enack/d5b75704726c0696c013ac26ae96b271 to your computer and use it in GitHub Desktop.
Save se7enack/d5b75704726c0696c013ac26ae96b271 to your computer and use it in GitHub Desktop.
Torrent Episode Renaming Tool
#!/usr/bin/env python3
import os
string2remove = ".720p.IBCTV.WEBRip.x264-GalaxyGlue"
edir = "/Users/user/Desktop/SomeGoodShowS01"
#edir = os.getcwd()
# Will reaname all files in the 'edir' by removing the above 'string2remove'.
# Example:
# Some.Good.Show.S01E##.720p.IBCTV.WEBRip.x264-GalaxyGlue.mp4 --> Some.Good.Show.S01E##.mp4
files = os.listdir(edir)
for file in files:
old_name = file
new_name = file.replace(string2remove, "")
os.rename(old_name, new_name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment