Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Quick python 3 program to rename files for downloaded TV series
import glob, os, re
for file in glob.glob('*[sS][0-9][0-9][eE][0-9][0-9]*'):
ep_string ='[sS][0-9]{2}[eE][0-9]{2}', file).group(0).upper()
file_type = file.split('.')[-1]
new_name = ep_string + '.' + file_type
os.rename(file, new_name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.