Verified Commit 02cc4fe4 authored by Valo's avatar Valo
Browse files

chan-dl: more generic defaults, remove http*://, some cleanup

parent c419fd6f
#!/bin/sh
#4format: 48chdl https://boards.4chan.org/.../thread/.../...
#8format: 48chdl https://8ch.net/.../res/.../...
#format: chan-dl [link]
DIRNAME=$(echo "$@" | sed -r 's/.+\:\/\///')
mediaserver=
case "$@" in
(*'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 ;;
(*'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
wget -P "$DIRNAME" -nd -c -r -R '*\.html','*s\.*' -l 1 -H -D "$mediaserver" -A png,gif,jpg,jpeg,webm "$@"
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)
......
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