-
Notifications
You must be signed in to change notification settings - Fork 0
/
collect.sh
executable file
·43 lines (35 loc) · 994 Bytes
/
collect.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
#!/bin/bash
# show commands and stop if there is an error
set -ex
# make the directory if it is not there
mkdir -p downloads
# clean the directory if there are old results
rm -f downloads/*
# get 5 pages
for PAGE in {1..3}
do
# this is an example with a group
URL='https://www.flickr.com/groups/hdr/pool/page'$PAGE
# this is an example with tags
# URL='https://www.flickr.com/photos/tags/'$SEARCH_STRING'/page'$PAGE
echo "about to fetch URL: " $URL
sleep 3
# fetch the images
wget --adjust-extension \
--random-wait \
--limit-rate=100k \
--span-hosts \
--convert-links \
--backup-converted \
--no-directories \
--timestamping \
--page-requisites \
--directory-prefix=downloads \
--execute robots=off \
--accept=.jpg \
$URL
# other unused arguments
# --recursive \
# --level 1 \
# --domains en.wikipedia.org \
done