forked from RohanMishra97/scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Imdb_folders.py
executable file
·31 lines (27 loc) · 1.03 KB
/
Imdb_folders.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
#! /usr/bin/python3
import shutil
import os
import re
source = os.listdir()
for files in source:
if files.lower().endswith('.mp4') or files.lower().endswith('.mkv') or files.lower().endswith('.avi'):
if os.path.getsize('./'+files) > 200000000:
os.makedirs('Movies',exist_ok=True)
dest = './Movies'
shutil.move('./'+files,dest)
else:
os.makedirs('Videos',exist_ok=True)
dest = './Videos'
shutil.move('./'+files,dest)
if files.lower().endswith('.jpg') or files.lower().endswith('.png'):
os.makedirs('Pictures',exist_ok=True)
dest = './Pictures'
shutil.move('./'+files,dest)
if files.lower().endswith('.pdf') or files.lower().endswith('.docx'):
os.makedirs('Docs',exist_ok=True)
dest = './Docs'
shutil.move('./'+files,dest)
if files.lower().endswith('.zip'):
os.makedirs('Compressed',exist_ok=True)
dest = './Compressed'
shutil.move('./'+files,dest)