I'm working on a cleanup script for tv shows that I download. Right now I'm just looking for a file greater than 50mb, but there should be a better way.
import os
import shutil
dir = "C:\Users\Bobe\Downloads\TV\\"
for folder in os.listdir(dir):
if os.path.isdir(os.path.join(dir,folder)):
for file in os.listdir(dir + folder):
filelocation = dir+folder+"\\"+file
if os.path.getsize(filelocation) > 50000000:
shutil.move(filelocation, dir + folder + ".avi")
else:
os.remove(filelocation)
shutil.rmtree(dir + folder)