How to use wget on a list of images
up vote
6
down vote
favorite
There's this beautiful boy who periodically uploads pictures of himself to his website. I am trying to automate the process of downloading these images to my computer.
So far, I'm able to download his webpage and parse it for jpg files. I end up with a file like this.
http://stat.ameba.jp/user_images/20120129/19/maofish/f9/60/j/o0480064011762693689.jpg
http://imgstat.ameba.jp/view/d/70/stat001.ameba.jp/user_images/20120127/22/maofish/f7/3e/j/t02200293_0480064011759076335.jpg
http://imgstat.ameba.jp/view/d/70/stat001.ameba.jp/user_images/20120125/18/maofish/80/46/j/t02200293_0480064011755033425.jpg
http://imgstat.ameba.jp/view/d/70/stat001.ameba.jp/user_images/20120120/20/maofish/3c/99/j/t02200290_0480063311745603530.jpg
http://stat.ameba.jp/user_images/20100219/16/maofish/33/0b/j/t01400198_0140019810420649113.jpg
http://stat.ameba.jp/user_images/b0/09/10101851128_s.jpg
http://stat.ameba.jp/user_images/9c/26/10027225053_s.jpg
I can get any of those images by doing a wget on them, but I would like to automate this process to get everything in the list. I tried piping and redirecting to wget, but it doesn't work. How can I accomplish what I'm trying to do?
linux wget
add a comment |
up vote
6
down vote
favorite
There's this beautiful boy who periodically uploads pictures of himself to his website. I am trying to automate the process of downloading these images to my computer.
So far, I'm able to download his webpage and parse it for jpg files. I end up with a file like this.
http://stat.ameba.jp/user_images/20120129/19/maofish/f9/60/j/o0480064011762693689.jpg
http://imgstat.ameba.jp/view/d/70/stat001.ameba.jp/user_images/20120127/22/maofish/f7/3e/j/t02200293_0480064011759076335.jpg
http://imgstat.ameba.jp/view/d/70/stat001.ameba.jp/user_images/20120125/18/maofish/80/46/j/t02200293_0480064011755033425.jpg
http://imgstat.ameba.jp/view/d/70/stat001.ameba.jp/user_images/20120120/20/maofish/3c/99/j/t02200290_0480063311745603530.jpg
http://stat.ameba.jp/user_images/20100219/16/maofish/33/0b/j/t01400198_0140019810420649113.jpg
http://stat.ameba.jp/user_images/b0/09/10101851128_s.jpg
http://stat.ameba.jp/user_images/9c/26/10027225053_s.jpg
I can get any of those images by doing a wget on them, but I would like to automate this process to get everything in the list. I tried piping and redirecting to wget, but it doesn't work. How can I accomplish what I'm trying to do?
linux wget
What have you already tried?
– r4.
Jan 30 '12 at 9:10
1
I have tried wget | list and wget < list.
– tony_sid
Jan 30 '12 at 9:12
add a comment |
up vote
6
down vote
favorite
up vote
6
down vote
favorite
There's this beautiful boy who periodically uploads pictures of himself to his website. I am trying to automate the process of downloading these images to my computer.
So far, I'm able to download his webpage and parse it for jpg files. I end up with a file like this.
http://stat.ameba.jp/user_images/20120129/19/maofish/f9/60/j/o0480064011762693689.jpg
http://imgstat.ameba.jp/view/d/70/stat001.ameba.jp/user_images/20120127/22/maofish/f7/3e/j/t02200293_0480064011759076335.jpg
http://imgstat.ameba.jp/view/d/70/stat001.ameba.jp/user_images/20120125/18/maofish/80/46/j/t02200293_0480064011755033425.jpg
http://imgstat.ameba.jp/view/d/70/stat001.ameba.jp/user_images/20120120/20/maofish/3c/99/j/t02200290_0480063311745603530.jpg
http://stat.ameba.jp/user_images/20100219/16/maofish/33/0b/j/t01400198_0140019810420649113.jpg
http://stat.ameba.jp/user_images/b0/09/10101851128_s.jpg
http://stat.ameba.jp/user_images/9c/26/10027225053_s.jpg
I can get any of those images by doing a wget on them, but I would like to automate this process to get everything in the list. I tried piping and redirecting to wget, but it doesn't work. How can I accomplish what I'm trying to do?
linux wget
There's this beautiful boy who periodically uploads pictures of himself to his website. I am trying to automate the process of downloading these images to my computer.
So far, I'm able to download his webpage and parse it for jpg files. I end up with a file like this.
http://stat.ameba.jp/user_images/20120129/19/maofish/f9/60/j/o0480064011762693689.jpg
http://imgstat.ameba.jp/view/d/70/stat001.ameba.jp/user_images/20120127/22/maofish/f7/3e/j/t02200293_0480064011759076335.jpg
http://imgstat.ameba.jp/view/d/70/stat001.ameba.jp/user_images/20120125/18/maofish/80/46/j/t02200293_0480064011755033425.jpg
http://imgstat.ameba.jp/view/d/70/stat001.ameba.jp/user_images/20120120/20/maofish/3c/99/j/t02200290_0480063311745603530.jpg
http://stat.ameba.jp/user_images/20100219/16/maofish/33/0b/j/t01400198_0140019810420649113.jpg
http://stat.ameba.jp/user_images/b0/09/10101851128_s.jpg
http://stat.ameba.jp/user_images/9c/26/10027225053_s.jpg
I can get any of those images by doing a wget on them, but I would like to automate this process to get everything in the list. I tried piping and redirecting to wget, but it doesn't work. How can I accomplish what I'm trying to do?
linux wget
linux wget
asked Jan 30 '12 at 9:08
tony_sid
5,55636108175
5,55636108175
What have you already tried?
– r4.
Jan 30 '12 at 9:10
1
I have tried wget | list and wget < list.
– tony_sid
Jan 30 '12 at 9:12
add a comment |
What have you already tried?
– r4.
Jan 30 '12 at 9:10
1
I have tried wget | list and wget < list.
– tony_sid
Jan 30 '12 at 9:12
What have you already tried?
– r4.
Jan 30 '12 at 9:10
What have you already tried?
– r4.
Jan 30 '12 at 9:10
1
1
I have tried wget | list and wget < list.
– tony_sid
Jan 30 '12 at 9:12
I have tried wget | list and wget < list.
– tony_sid
Jan 30 '12 at 9:12
add a comment |
2 Answers
2
active
oldest
votes
up vote
13
down vote
You can use -i
option of wget
such as:
$ wget -i input_file.txt
You will get all files downloaded in the current directory. You can see man wget
for more options.
Is there a way to tell wget to ignore images that are smaller than a certain size?
– tony_sid
Jan 30 '12 at 9:22
1
If the target is to remove the small files (less than some threshold), you can usefind
to delete them automatically after download.
– Khaled
Jan 30 '12 at 9:26
add a comment |
up vote
0
down vote
minsize="50" # grab all over 50kb
for x in $(cat list)
do
if [ "$(echo $(GET -Ssed $x | grep Length | awk '{print $2}') /128 |bc)" -ge $minsize ]; then
wget -q $x
fi
done
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
13
down vote
You can use -i
option of wget
such as:
$ wget -i input_file.txt
You will get all files downloaded in the current directory. You can see man wget
for more options.
Is there a way to tell wget to ignore images that are smaller than a certain size?
– tony_sid
Jan 30 '12 at 9:22
1
If the target is to remove the small files (less than some threshold), you can usefind
to delete them automatically after download.
– Khaled
Jan 30 '12 at 9:26
add a comment |
up vote
13
down vote
You can use -i
option of wget
such as:
$ wget -i input_file.txt
You will get all files downloaded in the current directory. You can see man wget
for more options.
Is there a way to tell wget to ignore images that are smaller than a certain size?
– tony_sid
Jan 30 '12 at 9:22
1
If the target is to remove the small files (less than some threshold), you can usefind
to delete them automatically after download.
– Khaled
Jan 30 '12 at 9:26
add a comment |
up vote
13
down vote
up vote
13
down vote
You can use -i
option of wget
such as:
$ wget -i input_file.txt
You will get all files downloaded in the current directory. You can see man wget
for more options.
You can use -i
option of wget
such as:
$ wget -i input_file.txt
You will get all files downloaded in the current directory. You can see man wget
for more options.
answered Jan 30 '12 at 9:17
Khaled
6291413
6291413
Is there a way to tell wget to ignore images that are smaller than a certain size?
– tony_sid
Jan 30 '12 at 9:22
1
If the target is to remove the small files (less than some threshold), you can usefind
to delete them automatically after download.
– Khaled
Jan 30 '12 at 9:26
add a comment |
Is there a way to tell wget to ignore images that are smaller than a certain size?
– tony_sid
Jan 30 '12 at 9:22
1
If the target is to remove the small files (less than some threshold), you can usefind
to delete them automatically after download.
– Khaled
Jan 30 '12 at 9:26
Is there a way to tell wget to ignore images that are smaller than a certain size?
– tony_sid
Jan 30 '12 at 9:22
Is there a way to tell wget to ignore images that are smaller than a certain size?
– tony_sid
Jan 30 '12 at 9:22
1
1
If the target is to remove the small files (less than some threshold), you can use
find
to delete them automatically after download.– Khaled
Jan 30 '12 at 9:26
If the target is to remove the small files (less than some threshold), you can use
find
to delete them automatically after download.– Khaled
Jan 30 '12 at 9:26
add a comment |
up vote
0
down vote
minsize="50" # grab all over 50kb
for x in $(cat list)
do
if [ "$(echo $(GET -Ssed $x | grep Length | awk '{print $2}') /128 |bc)" -ge $minsize ]; then
wget -q $x
fi
done
add a comment |
up vote
0
down vote
minsize="50" # grab all over 50kb
for x in $(cat list)
do
if [ "$(echo $(GET -Ssed $x | grep Length | awk '{print $2}') /128 |bc)" -ge $minsize ]; then
wget -q $x
fi
done
add a comment |
up vote
0
down vote
up vote
0
down vote
minsize="50" # grab all over 50kb
for x in $(cat list)
do
if [ "$(echo $(GET -Ssed $x | grep Length | awk '{print $2}') /128 |bc)" -ge $minsize ]; then
wget -q $x
fi
done
minsize="50" # grab all over 50kb
for x in $(cat list)
do
if [ "$(echo $(GET -Ssed $x | grep Length | awk '{print $2}') /128 |bc)" -ge $minsize ]; then
wget -q $x
fi
done
edited Dec 1 at 16:08
Scott
15.5k113889
15.5k113889
answered Feb 1 '12 at 23:24
tao
1,295710
1,295710
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f383890%2fhow-to-use-wget-on-a-list-of-images%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What have you already tried?
– r4.
Jan 30 '12 at 9:10
1
I have tried wget | list and wget < list.
– tony_sid
Jan 30 '12 at 9:12