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
02cc4fe4
Verified
Commit
02cc4fe4
authored
Aug 03, 2018
by
Valo
Browse files
chan-dl: more generic defaults, remove http*://, some cleanup
parent
c419fd6f
Changes
1
Hide whitespace changes
Inline
Side-by-side
bin/chan-dl
View file @
02cc4fe4
#!/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)
...
...
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