-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfa_redl.sh
executable file
·26 lines (20 loc) · 905 Bytes
/
fa_redl.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
#!/bin/bash
# Re-download furaffinity pics if you think they're impure
if [ $# -eq 0 ]; then
echo "Usage: ${0##*/} /path/to/files"
exit
fi
wget --no-verbose --show-progress --input-file /dev/fd/3 3<<<"$(
find "$1" -maxdepth 1 -type f -name "[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9].*.*" -printf '%f\n' |
while read -r fullfile; do
# Filename without extension
filename="${fullfile%.*}"
# Artist name only
artist=$(echo "${filename#*.}" | cut -d_ -f1)
# File ID only (not the same as post ID, so good fucking luck finding the original post!)
id="${filename%%.*}"
# Let's try both jpg and png because we don't know which one it is.
echo "https://d.facdn.net/art/$artist/$id/$filename.jpg"
echo "https://d.facdn.net/art/$artist/$id/$filename.png"
done
)"