summaryrefslogtreecommitdiff
path: root/bin/curld
blob: 6bfc0162ddd9825c29bf916bf32b2e115e941afb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash

work_dir=$(readlink -e "$0")
work_dir="${work_dir%/*/*}/work"

if [ ! -d "${work_dir}/files" ]; then
  mkdir -p "${work_dir}/files"
fi

while read -r url64; do
  [ -s "${work_dir}/files/${url64}" ] && continue
  url=$(
    printf -- '%s\n' "${url64}" \
    | base64 -d \
    || exit $?
  )
  curl -gqb "" -fLC - --retry 3 --retry-delay 3 -o "${work_dir}/files/${url64}" "${url}"
done \
<"${work_dir}/wishlist"