Verified Commit 4c05b70f authored by Valo's avatar Valo
Browse files

chan downloader optimization

parent 347eb3e4
......@@ -3,12 +3,11 @@
#8format: 48chdl https://8ch.net/.../res/.../...
case "$@" in
(*'4chan.org'*) DIRNAME=$(echo "$@" | sed -r 's/.+s\.(4chan).+g\/(.+)\/.+d\/(.+.)/\1\/\2\/\3/') ; wget -P "$DIRNAME" -nd -r -l 1 -H -D 4chan.org -A png,gif,jpg,jpeg,webm "$@" ;;
(*'8ch.net'*) DIRNAME=$(echo "$@" | sed -r 's/.+\/(8ch).+(\/.+\/).+\/(.+)\..+/\1an\2\3/') ; wget -P "$DIRNAME" -nd -r -l 1 -H -D media.8ch.net -A png,gif,jpg,jpeg,webm "$@" ;;
(*'4chan.org'*) DIRNAME=$(echo "$@" | sed -r 's/.+s\.(4chan).+g\/(.+)\/.+d\/(.+.)/\1\/\2-\/\3/') ; mediaserver=4chan.org ;;
(*'8ch.net'*) DIRNAME=$(echo "$@" | sed -r 's/.+\/(8ch).+(\/.+\/).+\/(.+)\..+/\1an\2\3/') ; mediaserver=media.8ch.net ;;
esac
rm -f $DIRNAME/*s\.* #delete all thumbnails
wget -P "$DIRNAME" -nd -c -r -R '*\.html','*s\.*' -l 1 -H -D "$mediaserver" -A png,gif,jpg,jpeg,webm "$@"
exit 0
#* TODO skip thumbnails and other junk (to save bandwidth and time)
#* TODO use funcs
#wget -e robots=off --wait 1 http://your.site.here
#* TODO add more options and customization, custom link
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment