-
Notifications
You must be signed in to change notification settings - Fork 0
/
copyfiles.py
40 lines (35 loc) · 1.29 KB
/
copyfiles.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import os
import re
import shutil
#path = 'D:/aaa'
path='C:/Users/andrea/Downloads/Torrent/Marvels.Jessica.Jones.S02.Season.02.COMPLETE.XviD-AFG'
wdir = os.listdir(path)
#destination = 'D:/bbb'
destination='C:/Users/andrea/Videos/Marvels.Jessica.Jones.S02.Season.02.COMPLETE'
for id in range(len(wdir)):
print(wdir[id])
if os.path.isdir(path + '/' + wdir[id]):
for ff in os.listdir(path + '/' + wdir[id]):
searchObj = re.search('avi$',ff)
if searchObj:
print(path + '/' + wdir[id] + '/' + ff)
shutil.copy2(path + '/' + wdir[id] + '/' + ff, destination)
'''
print(path + '/' + wdir)
print("----------------------------------------------------")
print(os.listdir(path + '/' + wdir))
print("----------------------------------------------------")
print("----------------------------------------------------")
'''
'''
for fdir in os.listdir(path + '/' + wdir):
if os.path.isfile(path + '/' + wdir + '/' + fdir):
continue
for ff in os.listdir(path + '/' + wdir + '/' + fdir):
#print(ff)
searchObj = re.search('mkv$',ff)
if searchObj:
print(path + '/' + wdir + '/' + fdir + '/' + ff)
shutil.copy2(path + '/' + wdir + '/' + fdir + '/' + ff, destination)
#shutil.copy2(path + '/' + wdir + '/' + fdir + '/' + ff, path + '/' + wdir)
'''