Created
November 14, 2013 19:35
-
-
Save racerxdl/7472937 to your computer and use it in GitHub Desktop.
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
import shutil | |
import os, os.path | |
count = 1 | |
eps = [] | |
seasons = [ 16 ,24 , 24 ] | |
doubles = [] | |
s = 1 | |
for numep in seasons: | |
print "Season %02d Episodes %03d" % (s,numep) | |
for i in range(1,numep+1): # S01 20 eps | |
if (count-1) in doubles: | |
count = count + 1 | |
x = (0,0,0) | |
eps.append(x) | |
else: | |
x = (count,s,i,(count in doubles)) | |
eps.append(x) | |
print "Ep %d => S%02dE%03d" %(count,s,i) | |
count = count + 1 | |
s = s + 1 | |
files = os.listdir('.') | |
c = 1 | |
for file in files: | |
data = file.split('.') | |
#ep = data[0].split('-') | |
epnum = int(c) | |
format = data[len(data)-1] | |
epdata = eps[epnum-1] | |
filename = "S%02dE%03d.%s"%(epdata[1],epdata[2],format) | |
print "Episode: %d Format: %s - %s" %(epnum, format, filename) | |
c = c + 1 | |
shutil.move(file,filename) | |
''' | |
files = os.listdir('.') | |
for file in files: | |
data = file.split('.') | |
ep = data[0].split('-') | |
epnum = int(ep[0].strip()) | |
format = data[len(data)-1] | |
epdata = eps[epnum-1] | |
filename = "S%02dE%03d - %s"%(epdata[1],epdata[2],file) | |
print "Episode: %d Format: %s - %s" %(epnum, format, filename) | |
shutil.move(file,filename) | |
''' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment