1. loose avi files
2. folders containing avi/mkv files and other files that are unwanted
3. folders containing segmented RAR archives of avi /mkv and other unwanted files
So, my configuration tree is:

An my modified version of the script is:
Code: Select all
import shutil
import os
IgnoreFileTypes = 'txt,nfo,pnr,!ut,sfv,rar,r00,r01,r02,r03,r04,r05,r06,r07,r08,r09,r10,r11,r12,r13,r14,r15,r16,r17,r18,r19,r20,r21,r22,r23,r24,r25,r26,r27,r28,r29,r30'
IgnoreFileNames = ('sample', 'ignore')
FileName = ''.join(eg.event.payload)
isFolder = os.path.isdir(FileName)
DestFolder = 'D:\\Torrent\\TheRenamer\\'
def CopyFileCheck(File):
CopyFile = True
for IgnoreText in IgnoreFileNames:
if IgnoreText in File:
CopyFile = False
if File[-3:] in IgnoreFileTypes:
CopyFile = False
return CopyFile
if not isFolder and CopyFileCheck(FileName):
shutil.copy(FileName, DestFolder)
print os.path.basename(FileName) + ' copied.'
elif isFolder:
for root, dirs, files in os.walk(FileName):
for f in files:
if CopyFileCheck(f):
shutil.copy(root+'\\'+f,DestFolder)
print f + ' copied.'I want it to exclude all the RAR segments, but the way I'm using is inelegant.
The only *problem* is, when the downloaded torrent is an AVI/MKV in a folder, the video file never gets copied.
It still beats the way I was doing it last week, but can anyone point me in the right direction here? Thanks!