Find the answer to your Linux question:
Results 1 to 7 of 7
Hi, Today I'm trying wget for the first time. So as a test I was trying to download the mpgs from nationalgeographic site like this: $ wget -r -nc -P ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie imranka's Avatar
    Join Date
    Dec 2007
    Location
    Kolkata
    Posts
    181

    wget - ..."since it should be rejected"


    Hi,

    Today I'm trying wget for the first time. So as a test I was trying to download the mpgs from nationalgeographic site like this:
    $ wget -r -nc -P ~/Download/wgetted/ -A.jpg http :// photography.nationalgeographic.com/photography/photo-of-the-day --progress=dot --wait=10
    Now its coming like this-

    19:41:34 (54.50 KB/s) - `/home/imran/Download/wgetted/photography.nationalgeographic.com/photography/photo-of-the-day' saved [39788/39788]

    Removing /home/imran/Download/wgetted/photography.nationalgeographic.com/photography/photo-of-the-day since it should be rejected.
    And so on and on and on.....

    Question: Why it seems its downloading the jpgs and then removing? Why it "should be rejected"?
    Last edited by imranka; 08-27-2008 at 02:15 PM. Reason: Added one line
    Imran
    Linux User #467555 | Debian Squeeze | Intel(R) Core(TM)2 Duo CPU 4500 @ 2.20GHz | Gigabyte GA-G41MT-ES2L
    | 2 GB RAM | 320 GB SATA | Kernel: 2.6.32-5-686

  2. #2
    Linux Guru smolloy's Avatar
    Join Date
    Apr 2005
    Location
    CA, but from N.Ireland
    Posts
    2,414
    Try
    Code:
    wget -A.jpg -r -nc -P ~/Download/wgetted/ -A.jpg http://photography.nationalgeographic.com/photography/photo-of-the-day --progress=dot --wait=10
    (I just added -A.jpg to the options list.)
    Registered Linux user #388328 || Registered LFS user #15880
    AMD 64 X2 4600+ :: 2X1GB DDR2 800 :: GeForce 9400 GT 512MB :: ASUS M2N32 Deluxe :: 4X250GB SATAII
    Need instant help? Try us on IRC -- #linuxforums on freenode

  3. #3
    Linux Guru smolloy's Avatar
    Join Date
    Apr 2005
    Location
    CA, but from N.Ireland
    Posts
    2,414
    Update: I think the reason this is being rejected is that it's not actually a jpeg. You're trying to wget the whole page -- html, jpegs, everything!

    When I use the command I gave in my last post, I get a couple of jpegs in Downloads/wgetted, for example
    Code:
    photography.nationalgeographic.com/staticfiles/NGS/Shared/StaticFiles/Photography/Images/POD/f/french-quarter-sacha-657502-ga.jpg
    Notice that it doesn't keep the files in Downloads/wgetted, but rather in directories much lower down.
    Registered Linux user #388328 || Registered LFS user #15880
    AMD 64 X2 4600+ :: 2X1GB DDR2 800 :: GeForce 9400 GT 512MB :: ASUS M2N32 Deluxe :: 4X250GB SATAII
    Need instant help? Try us on IRC -- #linuxforums on freenode

  4. #4
    Linux Newbie imranka's Avatar
    Join Date
    Dec 2007
    Location
    Kolkata
    Posts
    181
    Nope. Its the same thing. Like this-
    21:17:13 (68.39 KB/s) - `/home/imran/Download/wgetted/photography.nationalgeographic.com/photography/pod-email/french-quarter-sacha.html' saved [37821/37821]

    Removing /home/imran/Download/wgetted/photography.nationalgeographic.com/photography/pod-email/french-quarter-sacha.html since it should be rejected.
    And anyway, there is the option "-A.jpg" already in what I've tried. So, why give it twice?
    Imran
    Linux User #467555 | Debian Squeeze | Intel(R) Core(TM)2 Duo CPU 4500 @ 2.20GHz | Gigabyte GA-G41MT-ES2L
    | 2 GB RAM | 320 GB SATA | Kernel: 2.6.32-5-686

  5. #5
    Linux Newbie imranka's Avatar
    Join Date
    Dec 2007
    Location
    Kolkata
    Posts
    181
    Oh yes, I got that image also, and only that image.

    Well, my original intention was to get the full size image of the current date, but the url will be changing every day, like
    http://photography.nationalgeographi...raphy/enlarge/french-quarter-sacha_pod_image.html
    and giving till
    will give 404 error. So how to do that?
    Imran
    Linux User #467555 | Debian Squeeze | Intel(R) Core(TM)2 Duo CPU 4500 @ 2.20GHz | Gigabyte GA-G41MT-ES2L
    | 2 GB RAM | 320 GB SATA | Kernel: 2.6.32-5-686

  6. #6
    Linux Newbie imranka's Avatar
    Join Date
    Dec 2007
    Location
    Kolkata
    Posts
    181
    Oh yes, I got that image also, and only that image. Sorry, I forgot to mention that.

    Well, my original intention was to get the full size image of the current date, but the url will be changing every day, like
    http://photography.nationalgeographi...raphy/enlarge/french-quarter-sacha_pod_image.html
    and giving till
    will give 404 error. So how to do that?

    And also, can I escape those many subdirectories? I want the jpgs straight in wgetted directory. Is that possible?
    Imran
    Linux User #467555 | Debian Squeeze | Intel(R) Core(TM)2 Duo CPU 4500 @ 2.20GHz | Gigabyte GA-G41MT-ES2L
    | 2 GB RAM | 320 GB SATA | Kernel: 2.6.32-5-686

  7. #7
    Linux Guru smolloy's Avatar
    Join Date
    Apr 2005
    Location
    CA, but from N.Ireland
    Posts
    2,414
    Quote Originally Posted by imranka View Post
    And anyway, there is the option "-A.jpg" already in what I've tried. So, why give it twice?
    Sorry about that!! I didn't notice.

    Anyway, notice that it's rejecting an html file, not a jpg. The jpg's are being kept.
    Code:
    cd Download/wgetted
    find ./ | grep jpg
    That will provide you a list of any jpg files in the wgetted folder.
    Registered Linux user #388328 || Registered LFS user #15880
    AMD 64 X2 4600+ :: 2X1GB DDR2 800 :: GeForce 9400 GT 512MB :: ASUS M2N32 Deluxe :: 4X250GB SATAII
    Need instant help? Try us on IRC -- #linuxforums on freenode

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •