Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Valo
f
Commits
4c05b70f
Verified
Commit
4c05b70f
authored
Jun 30, 2018
by
Valo
Browse files
chan downloader optimization
parent
347eb3e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
bin/48chdl
View file @
4c05b70f
...
...
@@ -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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment