-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtorrentsort.sh
executable file
·83 lines (74 loc) · 1.87 KB
/
torrentsort.sh
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
# delete unwanted files
find . -type f -name '*.txt' | while read line; do
title=$line;
rm -f "$title"
done
find . -type f -name '*.nfo' | while read line; do
title=$line;
rm -f "$title"
done
find . -type f -name '*.NFO*' | while read line; do
title=$line;
rm -f "$title"
done
find . -type f -name '*.jpg' | while read line; do
title=$line;
rm -f "$title"
done
find . -type f -name '*sample*' | while read line; do
title=$line;
rm -f "$title"
done
find . -type f -name '*.Sample*' | while read line; do
title=$line;
rm -f "$title"
done
# Series
find . -type f -name '*Vikings*' | while read line; do
title=$line;
mv -f "$title" ../Vikings/
done
find . -type f -name '*Robot*' | while read line; do
title=$line;
mv -f "$title" ../MrRobot/
done
find . -type f -name '*Thrones*' | while read line; do
title=$line;
mv -f "$title" ../Game\ of\ Thrones/
done
find . -type f -name '*Westworld*' | while read line; do
title=$line;
mv -f "$title" ../Westworld/
done
find . -type f -name '*Korra*' | while read line; do
title=$line;
mv -f "$title" ../Avatar/
done
find . -type f -name '*Stranger.Things*' | while read line; do
title=$line;
mv -f "$title" ../StrangerThings/
done
find . -type f | grep '[sS][0-9][0-9]' | while read line; do
title=$line;
mv -f "$title" ../UnsortedSeries/
done
# hopefully all that's left is movies and their subtitles
find . -type f -name '*.mp4' | while read line; do
title=$line;
mv -f "$title" ../MOVIES/
done
find . -type f -name '*.mkv' | while read line; do
title=$line;
mv -f "$title" ../MOVIES/
done
find . -type f -name '*.avi' | while read line; do
title=$line;
mv -f "$title" ../MOVIES/
done
find . -type f -name '*.srt' | while read line; do
title=$line;
mv -f "$title" ../MOVIES/
done
#delete empty directories
find . -type d -empty -delete