-
Notifications
You must be signed in to change notification settings - Fork 0
/
liftoff.sh
71 lines (58 loc) · 1.5 KB
/
liftoff.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
#!/bin/bash
# Availible Resolutions
echo "
Widescreen 16:9
-------------------
- 6400x3600
- 5120x2880
- 4096x2304
- 3840x2160
- 3200x1800
- 2880x1620
- 2560x1440
- 1920x1080
Widescreen 16:10
-------------------
- 6400x4000
- 5120x3200
- 3840x2400
- 3360x2100
- 2880x1800
- 2560x1600
- 2304x1440
- 2048x1280
- 1920x1200
Ultrawide 21:9
-------------------
- 3840x1600
- 3440x1440
- 2560x1080
"
read -p "~ Select Resolution: " resolution
SUB='x'
if [[ "$resolution" == *"$SUB"* ]]; then
echo "$resolution Selected"
resolution_size="$resolution"
else
echo "Please select a valid resolution next time."
exit
fi
# Search Pages
read -p "~ Pages to Search: " page_number
if [ -z "$page_number" ]; then
echo "Oops! Please enter a page number next time."
exit
fi
if (("$page_number" > "300")); then
echo "It would be wise to search below 300 pages."
exit
fi
echo "~ New images will be saved to $resolution_size/"
echo "~ Bees deployed! Search and Download in progress"
for page in $(seq 1 $page_number); do
curl -s -A "Mozilla" https://interfacelift.com/wallpaper/downloads/date/any/$resolution_size/index$page.html | grep -Po '(?<=href=")[^"].*'$resolution_size'.jpg' | sed -e 's/^/https:\/\/interfacelift.com/' | xargs wget --user-agent=Mozilla -nv -nc --show-progress -P ./$resolution_size/
done
# Cleaning junk images
find ./$resolution_size/ -type f -iname "*.jp*g" -size -50k -exec rm {} \;
echo "~ All Done!"
echo "~ $resolution_size/ now contains $(ls -1 ./$resolution_size/ | wc -l) images"